• Hi,

    Firstly, thanks for building this very useful plugin and making it freely available.

    I’ve been experimenting with the page cache and cache priming options. I see that pages listed in the priming sitemap will only be regenerated at the set interval if the current cached version has expired. I understand this makes sense generally, but is it possible to force the cached version(s) to be updated at the specified interval?

    Note that I’ve set DISABLE_WP_CRON to true and am running wp-cron via a cron job.

    Regards

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

    (@vmarko)

    Hello @wamwebdev

    Thank you for reaching out and I am happy to help!
    If you are using custom cron you can set the specific time when the preload should start (Note that priming will start from the beginning once the end of the sitemap is reached)
    Alternatively, you can use wp-cli and call wp w3-total-cache pgcache_prime [--start=<start>] [--limit=<limit>]
    Let me know if this helps!

    Thanks!

    Thread Starter wamwebdev

    (@wamwebdev)

    Hi Marko,

    Thanks for the quick response. I will try to explain my query with an example:

    If I have the cache object lifetime set at e.g. 3600s and the prime update interval set at e.g. 900s, the pages in the prime sitemap won’t be regenerated until they expire (after 3600s). What I’m asking is whether there’s a way to override this rule, such that primed pages are always regenerated at the update interval.

    Obviously you could set the update interval and the cache lifetime to “match”, but due to the finite time it takes to prime a series of pages, and the fact that the pages won’t be regenerated unless they have completely expired, there’s too much room for user requests to potentially affect the update timing.

    The reason I’m asking this is because we have content that is displayed differently depending on the time of day. This content is (typically) already published, and can change on the hour or half-hour. So the purge policy for published posts won’t work in this case.

    I hope you now understand my query!

    Regards

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wamwebdev

    Thank you for your feedback
    I am interested to see how you configured the cache priming. Does the sitemap contain all URL’s? How many urls/pages are in on the website?

    What the feature does is this:
    – Check the last offset
    – Check how many URLs are allowed to be processed per run
    – Fetch all URLs from sitemap (even nested sitemaps work)
    – Loop through a set of URLs to visit them

    If the end of the list is reached, it will start from the beginning in the next run

    Basically it’s like visiting the website to do what a real visitor would do otherwise. The cron job triggers the page cache generation, so the real visitors won’t experience any delay. Meaning, the cache will be primed again even if it’s not expired

    I hope this helps!

    Thread Starter wamwebdev

    (@wamwebdev)

    Hi Marko,

    Thanks for that information. My setup has just 2 URLs in the prime sitemap currently (it’s a staging site). I’m only interested in priming the cache for a particular set of URLs, as most of the site is fairly static content-wise. My Cron job calls wp-cron every minute, and the 2 URLs are generated in about 4 or 5 seconds.

    I understand that this is in effect imitating users visiting pages and generating cached versions. But what I want to achieve is that the cache priming happens, without fail, every 15 minutes, irrespective of cache page lifetime or when a user last visited a one of the sitemap pages. Is this possible with W3TC?

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.