WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I m using w3 total cache plugin with wooCommerce, it works fine but I have a single issue, which is, it caches the whole page but I do not want to cache the div that is showing amount of the cart.

How can I do it?

share|improve this question

closed as off-topic by Pieter Goosen, birgire, Johannes Pille, shea, gmazzap Aug 20 '14 at 12:22

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." – Pieter Goosen, birgire, Johannes Pille, shea, gmazzap
If this question can be reworded to fit the rules in the help center, please edit the question.

your question is off-topic as you ask about plugins and not about wordpress core. I added a relatively generic answer, but the best plugin specific answer you can get only at the support forums of the plugins. – Mark Kaplun Dec 18 '13 at 10:55
can it is possible,do not cache header.php file. – er_Rajendraa Dec 18 '13 at 12:17

W3TC, like super cache and others, does full page caching, you can't tell it to ignore portions of pages as it will in practice mean that it will not cache those pages any longer, or will do partial caching which much less effective.

You have 3 options to include dynamic content in a cached page

  1. don't cache the page. shopping carts usually set up a cookie you you can configure W3TC, usually in the .htaccess file, not to serve cached content when it detects that value.

  2. use an iframe to host the shopping cart instead of the div. The caching plugin should be configured to no cache the iframe page and it should be something very simple like displaying info from a cookie that will not require running the wordpress core (otherwise you lose almost all advantage of caching)

  3. use JS to generated the div. this is probably the best approach if all info is in cookies.

share|improve this answer

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