• Resolved metricmedia

    (@metricmedia)


    We manage a store with a page that has 650 items on it. When this page is cached it loads very fast. When not cached it can take 30 seconds or longer to render.

    In experiments where we forcibly expired the page cache (updating the file mod date and editing the “time” value in the cache file), we notice that when we hit the page and the cache is being regenerated:

    – The cache file’s mod date is immediately updated.
    – The cache file’s size remains the same – so presumably all the “old” cache data is still there.
    – While it’s generating, hitting the page with another browser gives us the message “waiting for cache” in the browser status bar.
    – Once the caching is completed, the mod date of the file is updated again.

    Our assumption is that during regeneration the existing cache file is retained but rendered unusable until regeneration is complete.

    Is there a way around this? Is there a way that a page can continue using the “old” cache while the new cache is being generated?

    As it is we’re getting some grief from the client because customers are dealing with this 30 second wait at times. We are considering building our own solution but if there’s a way to control how W3TC does this we can continue using it, which is our preference.

    Thanks if anyone has any ideas.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @metricmedia

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    Can you please share the website URL?
    There is no way that the page is using the old cache file while the new one is generated. Once the cache is cleared, and the page is visited, a new cache file for that page is created.
    This all depends on how heavy your page is. Also, there might be some server restrictions. Using the Memory-based caching method can help with this like Memcached or Redis.
    Can you also share the settings in Performance>Browser Cache>HTMl&XML?
    Thank you!

    Thread Starter metricmedia

    (@metricmedia)

    Thanks Marko.

    Here’s the worst page on our site: https://www.potluckpress.com/shop/greeting-cards/ Currently it’s quick because it’s cached, but if it’s not cached the load time is about 30 seconds. Granted it is a lot of content, but it works quite well when cached.

    Settings – Browser Cache/HTML&XML:
    Everything checked except W3 Total Cache and HTTP (brotli) compression
    Expires header lifetime 3600 seconds
    Cache control policy: cache with max age (“public, max-age=EXPIRES_SECONDS”)

    We manually prime the cache in the middle of the night, which appears to be working correctly based on cache file mod dates.

    In Page Cache-> Advanced we have Maximum lifetime set to 86400 and garbage collection at 3600.

    We’re happy to try any other settings you might suggest.

    We aren’t sure why sometimes a user experiences cache regeneration during the day. Could one of our settings be allowing cached files to expire too soon (we want them to persist for 1 day unless they are intentionally purged)?

    I’m interested to know more about Memcached or Redis. Which areas of performance might these improve?

    Thank you!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @metricmedia

    There is nothing that I may suggest that would change anything. It’s simply the case of how heavy your page is.
    As for Memcached and Redis, accessing data from memory is usually faster than accessing data from disk but it’s non-persistent. Content is available until you close the Browser.
    “Disk Cache” is persistent. Cached resources are stored and loaded to and from disk. If you have a website with high traffic it is always better to use memory-based caching.
    Thanks!

    Thread Starter metricmedia

    (@metricmedia)

    We are thinking about creating a script that will replicate the page cache to a separate location that does not get wiped out whenever cache is regenerated.

    If we can then tell W3TC to serve up page cache files from that location (even though it’s writing them to the normal location), that’ll ensure we always have a valid cache file at all times.

    I realize this would be “voiding the warranty” but can you tell me where the path to page cache is managed when displaying a page to the public? If not no worries – we can look around. Obviously any edits of this sort will be removed by future plugin updates, so we’ll need to re-apply them if necessary.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @metricmedia

    You can try something like this https://ww.wp.xz.cn/support/topic/custom-folder-for-cache-not-working/
    I hope this helps!
    Thank you!

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

The topic ‘Not disabling current page cache while new page cache being generated?’ is closed to new replies.