Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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, bungeshea_, G. M. Aug 20 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, bungeshea_, G. M.
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

1 Answer 1

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.