I'm running a WP site with WooCommerce and I want to do some caching. I'm going to exclude the pages such as the cart/checkout for obvious reasons however there are a couple of the things on the site I would like to stay dynamic and not be cached.

An example is the number of items in the cart and there's also a block of html that displays differently whether you're logged in or not.

So my question is, should I load these via AJAX or should I define them as fragments using mfunc? What are the advantages and benefits for each and which one is recommended for this task?

closed as off-topic by mrwweb, birgire, Nicolai, Johannes Pille, Pieter Goosen Aug 30 '14 at 4:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – mrwweb, birgire, Nicolai, Johannes Pille, Pieter Goosen
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Good question, have you found any answer for it somewhere? Thank you. – Marvin3 May 12 '13 at 9:29
  • How many hits do you get on the site? – Brian Fegter Sep 10 '13 at 5:52

I'm not a friend of link only answers, but as I can't bind the whole source code + explanation in here, I'll just leave a link to @Rarst Fragment Cache Plugin.

Not the answer you're looking for? Browse other questions tagged or ask your own question.