WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
w3 total cache multisite setup featured posts on main site from sub sites (40 posts)

  1. upadhyay.kamal
    Member
    Posted 3 years ago #

    Hi!

    I am trying to use w3-total-cache plugin on multi-site sub-folder setup. I am using a switch_to_blog() function to show featured posts from different blogs on the main blog front page of my site. When I enable w3 total cache on my site all the sub folder sites work properly but image from the featured post from different sub folder site which were being shown on the front page of the main site disappear. I did view source and found that incorrect URL is being created for the images from sub-folder sites. For some reason w3-total-cache is not able to detect that images belong to sub-folder sites and are just being shown on the main site using switch_to_blog() function. URL for images which is being created by w3-total-cache plug-in is trying to fetch images from image folder of the main site (i.e. wp-content/upload...) while images are present in the image directory of the sub-folder site.

    Please let me know if there is a way to fix this problem. I am not able to use this excellent plugi-n just because of this problem.

    Thanks,
    Kamal

  2. Two options come to mind.

    Once is to not cache the front page. The other is to setup .htaccess redirects so the image locations are parsed.

    Are you sure it's the plugin? That is, does it work when the plugin's turned off?

  3. upadhyay.kamal
    Member
    Posted 3 years ago #

    Yeah this works when plug-in is turned off. I am okay with not caching front page or may be the entire main site but it doesn't work even if I am enabling plugin only for sub-folder sites. So I can't use this plugin at all.

  4. Bill Dennen
    Member
    Posted 3 years ago #

    (at the risk of sounding like a broken record on this switch_to_blog thing...)

    Are you using WP3?

    switch_to_blog is not fully functional in WP3. I hesitate to say it's broken. But, it does not function the same in WP3 as it does in 2.9.2.

  5. By WP3 he means WordPress 3.0

    I was starting to wonder if that might not be it, xyzzy :(

    (Does magic coolness happen now that I typed your name?)

  6. Bill Dennen
    Member
    Posted 3 years ago #

    Plugh! :)

    You know what... I completely disabled W3 Total Cache on my WordPress 3.0.1 install and my permalinks via switch_to_blog are working better. Previously, they were broken and it looked like this issue:

    http://core.trac.wordpress.org/ticket/12040

    But, now, without W3 Total Cache in the picture, the links look as they do on WordPress 2.9.2. Unless I'm going crazy, which is possible. :)

    I'm still digging. But, for now, I will keep W3 Total Cache off.

    (For what it's worth: WP Super Cache does not exhibit this problem)

  7. Fee Fie Foe Foo

    Interesting. I don't use switch_to_blog at all and I've not had issues with W3TC. I wonder what it could be that breaks it, though. There are a LOT of options with minification etc. Maybe you could play around with those?

  8. @xyzzy I know you on twitter with a different username, don't I?

  9. Bill Dennen
    Member
    Posted 3 years ago #

    ha ha. Yes @andrea_r.

    I had the problems with W3 total cache even when I disabled the cache via the plugin settings. The problems went away when I disabled and deleted the plugin itself! Very weird.

  10. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    I'm not clear on what module is mis-behaving in W3TC, can you please submit a bug submission form with more details?

  11. Bill Dennen
    Member
    Posted 3 years ago #

    Frederick, sure, I'll try. :)

  12. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Success? Not sure I received it.

  13. Bill Dennen
    Member
    Posted 3 years ago #

    not yet, need to reinstall/configure the plugin in our dev environment to reproduce.

  14. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Ok.

  15. upadhyay.kamal
    Member
    Posted 3 years ago #

    Yes xyzzy is right. I was facing the problem even when I disabled caching from the w3tc plugin. I had to disable and delete the plugin to fix the issue.
    I am not sure if the bug is already submitted.

    Let me know if it has not been submitted and debugging information is required. I have a test setup of my website where I can reproduce the issue.

  16. Jeff Farthing
    Member
    Posted 3 years ago #

    Same issue here. W3TC breaks switch_to_blog() and all other cross-blog functions, such as get_blog_permalink(), get_home_url(), get_blog_option(), etc.

  17. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    switch_to_blog()

    Will be handled in an upcoming release. As for the rest of those functions, I'm not aware of complications.

  18. robertjakobson
    Member
    Posted 3 years ago #

    My problem with the plugin is that, say one activates it one the main site of the multisite installation, http://www.domain.com, and then tries to add another blog, say http://www.domain.com/en/ - but the caching plugin does not recognizie the url domain.com/en/ as belonging to the different blog and caches it and makes WordPress return an 404 page from the main site.

    Hear me F.T.?

  19. robertjakobson
    Member
    Posted 3 years ago #

    Just another empty to post in order to notify me of followup posts via e-mail.

  20. robertjakobson
    Member
    Posted 3 years ago #

    I got my problem fixed my de-activating the plugin after creating the new blog with WP Multisite

  21. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Great.

  22. Khairendra
    Member
    Posted 3 years ago #

    I have the same problems with cross-blog functions, if i activate the W3 Total Cache plugin in my WP multisite, but i think i have spotted the problem (i hope).

    The problem is in object cache. So this is what i do. i enable the page cache, minify, database cache, browser cache (or any cache feature u want) but not the Object Cache, and then i delete wp-content/object-cache.php (i dont need it since i disable it). The plugin now working like a charm. The cross-blog functions like get_blog_permalink(), get_home_url(), get_blog_option() works fine.

    But actually i really want the object cache works too, since it will greatly increase my site performance.

    Frederick, i hope you find the best solution for us.

    This is a great plugin.

  23. There's a trac ticket out about this...

    http://core.trac.wordpress.org/ticket/14992

  24. jonathandietz
    Member
    Posted 3 years ago #

    I ran into this problem and found that adding wp_cache_flush() to the page you're using switch_to_blog() on fixes the URLs.

    Definitely not a fix, but just giving people options to get their URLs working again.

  25. helmi
    Member
    Posted 3 years ago #

    Running into the same problem with switch_to_blog completely not working when w3tc is turned on. This is a horrible situation for us as we just fininshed developing a site where switch_to_blog is used often and that relied on w3tc during the last months.

    I hope there will be an update soon that fixes the problem.

  26. @helmi, I was about to test this with the plugin. If you use wp_flush_cache() AFTER you're done with the switch to blog calls, it works perfect.

  27. helmi
    Member
    Posted 3 years ago #

    but this flushes the w3tc cache, doesn't it?

  28. Theoretically, just the object cache. Not ideal by any means, of course. Alternatly you could use RSS.

  29. helmi
    Member
    Posted 3 years ago #

    RSS is no option unfortunately as we use switch_to_blog to fetch the wp menu from another blog and some more complicated post feeds.

    I'll try this workaround. Frederic answered on twitter that the bug fix release will be there "soon" but he didn't define "soon" unfortunately :)

  30. nm
    Member
    Posted 3 years ago #

    I'm getting this too with the switch_to_blog. I'm glad there is a fix on its way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic