• Resolved mattjob

    (@mattjob)


    I am wanting to set-up Redis Object cache in such as fashion that if a user hits a stale record, the stale record is served and in the background a fresh record is made. I have seen some Redis Page Cache plugins that do this but really would like it for object caching from W3 Total Cache and wondering if it is possible?

    I am working on a real estate site and some of the objects just take time to construct. Site with object caching takes less than 50ms to serve as long as its within the TTL set in W3 Total Cache, but if over the TTL can take 5000ms with some of the pages that have thousands of properties.

    I have a Redis server with plenty of ram to hold the entire site and of course max memory and policy are set just in case. I see my keys are not being evicted from Redis after expire which is the behavior we want but if someone hits a key that has an expired TTL then they get to wait for the regeneration and we would rather them see a fast stale page and the next visitor or even the same user on refresh would get the new. its not that critical if a couple new houses went active in MLS since the last refresh which we set at 3 hours anyway and end users fast experience is preferred.

    any suggestions on how to accomplish this?

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

    (@vmarko)

    Hello @mattjob

    Thank you for reaching out and I am happy to help!
    Just to clarify, you would basically want this to behave like Page Cache Preload and always have preloaded objects?

    If this is the case, I am not sure this can be achieved with object Caching. You can set the expire value for longer time periods if you have a server with lot of resources.
    I need to double check this and confirm, so I’ll get back to you with more information.

    Thanks!

    Thread Starter mattjob

    (@mattjob)

    A Preload would be great if possible, I was just looking for a way to serve the stale record while a new record was generated but a full blown Preload would be better

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @mattjob

    This is not possible at the moment.
    However, you can ustilize the Page Caching preload in the W3 Total Cache and preload all the pages which will always serve the fresh cache to the visitors.

    Thanks!

    Thread Starter mattjob

    (@mattjob)

    Page Caching does not really work in this instance, too many dynamic objects and page is slow without pre-primed object caching. I did figure out a workaround off your page caching preload idea…. load the pages from a outside of word press source to prime the object cache. just wrote a php file that reads the sitemap.xml and loops though file_get_contents() for each page, run it automatically every hour with W3 cache set TTL to 7200 seconds

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redis Allow Stale Cache’ is closed to new replies.