• Resolved peterlarsen7470

    (@peterlarsen7470)


    Hi there,

    I’m setting up WP Super Cache on a WooCommerce shop and I’m a bit confused about the cache timeout settings. On some websites, it says the timeout should be 3,600 seconds, while others recommend 7,200 or even 86,400.
    From my own tests, I have the impression that WP Super Cache doesn’t cache product text, stock, or price. But is it only stock and price?

    So what’s correct? Does WP Super Cache cache WooCommerce product details? And why not use 86,400? I’d like all pages cached for as long as possible.
    Hope you can shed some light on this.

    Cheers,
    Peter

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    There’s no one correct timeout for the cache. For me, it all depends on two things.

    1. 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.
    2. 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.

    Thread Starter peterlarsen7470

    (@peterlarsen7470)

    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. 🙂

    Thread Starter peterlarsen7470

    (@peterlarsen7470)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.