mfunc fragment caching stops pages from being cached
-
Hi,
I am hoping I can get some urgent and much needed help with this.
I am noticed I was having an issue with W3TC where the page caching was caching the page fragment in my template that is the Woocommerce cart widget in the header.php file. Basically, if I visited a page, then went to another to add a product to my cart and then went back to a page I had already visited, it would say the cart was empty. If I think went to a page I hadnt already visited, it would correctly state what I had in the cart.
OK, I used mfunc to deal with this, thusly…
<div id="top-cart" class="shopping-cart-wrapper widget_shopping_cart"> <!--mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> --> $cart_widget = new Etheme_WooCommerce_Widget_Cart(); $cart_widget->widget(); <!--/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> --> </div>
This seems to work fine but it now have an issue where it now wont cache the page! I have tried clearing all wp-content>cache>page_enhanced via FTP but when I do this, the cache is not being recreated and it is KILLING my page speed – I have gone from the frontpage loading in 0.5 seconds (as per Pingdom) to it taking 2.5 seconds.
One other thing I noticed was that before I cleared the cache using FTP is that sometimes (again according to Pingdom) a cache version would be loaded, the next time an uncached version. This seemed to alternated one after the other.
Any idea what I can do to solve this? I would very much like to get this sorted.. it’s on a live site and I have had to remove page caching in order for the cart to work but this is KILLING the pagespeed and makes for a pretty awful user experience.
Can anyone help?
Thanks,
U4EA
- The topic ‘mfunc fragment caching stops pages from being cached’ is closed to new replies.