There’s no one correct timeout for the cache. For me, it all depends on two things.
- How big your site is. If you have many pages that can be cached then the cache can become so big it will take up a sizeable chunk of your storage.
- How often you update your site, or have widgets that display data from external sources. Editing a post will clear the cache for that post, but what if that post content is cached somewhere else in a widget?
WooCommerce has code that disables the cache on product pages AFAIR, so if the rest of your site is mostly static and unchanging then make it cache for as long as you want. Test it when you enable caching. Check the site as a logged out, anonymous visitor, and make sure it works and updates when you buy products or edit products.
Thank you for the reply.
The site has about 1,500 products, so the cache should be around 10 -20GB. That’s fine, I currently have 100 GB of space.
Looking at the cache file log, it contains all the product pages and categories. OK, I’ll test whether updating a product price or buying a product changes the HTML in the physical cache file (in the supercache folder).
I’ll make some test orders and get back with an update. 🙂
I have tested:
Change price
Change category
Change product image
Change product name
Every time something is saved, the HTML goes into a .needs-rebuild state.
So the cache is not updating the file instantly, but the next time a user hits the page.
That’s good enough for WooCommerce.
A purchase also puts the HTML into a rebuild state. The same happens when an order is cancelled and items are restocked. So there is definitely some e-commerce logic built into WP Super Cache.
I have set the cache to 43,200 seconds (12 hours) and have had no problems so far.