• Resolved stevecurrey

    (@stevecurrey)


    Hi

    I am unsure if there is something obvious I am missing with this plugin.

    I use the cache prime feature and set the pages per request to 40 and the interval to 900 seconds.

    I set this running this morning and checked via FTP and could see all of the cached pages in the correct directory.

    I opened an Incognito tab and browsed to the site. The site was very slow so I checked the cache directory again.

    Most of the cached directories were only minutes old but they were being regenerated on each page visit.

    I was not logged in as a user / customer (using WooCommerce).

    Any help greatly appreciated.

    Thank you

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

    (@vmarko)

    Hello @stevecurrey

    Thank you for your inquiry and I am happy to assist you with this.
    Once the Priming Cache cycle is finished, it starts again from the beginning. If some page is updated or a new article published the cache is purged and the cycle starts again also.
    Native wp-cron is not very reliable so you should use wp-cli instead.
    So, instead of calling wp cron via crontab – you should call it directly via
    wp w3-total-cache pgcache_prime
    and track the output which pages/sitemap positions are primed by script.
    Thanks!

    Thread Starter stevecurrey

    (@stevecurrey)

    Hi Marko,

    Many thanks for your prompt reply.

    There had been no changes on the site or pages updated.

    I assume that is a single post or product is updated, not the entire cache is purged – just the post / product. Is that correct?

    Thank you.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stevecurrey

    That’s correct. Also, when viewing the page for the first time, if it’s not cached in the browser it may take a bit more time than usual.
    Thanks!

    Thread Starter stevecurrey

    (@stevecurrey)

    Hi Marko,

    That’s the problem.

    The cache is being primed as I can see the files in FTP but when I visit the page, the cache is created again so I am not seeing any speed increase at all.

    If I then visit the page again straight away it’s very quick but if I leave it an hour, it’s slow and regenerates again.

    Thank you

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,

    As I explained, when the cycle is over the cache starts priming again.
    This is the way the Cache Preload works.
    If you don’t’ want that, you should prime your pages all at once (which can consume a lot of resources on your server). And once the cache is primed you can disable it.
    Thanks!

    Thread Starter stevecurrey

    (@stevecurrey)

    Thank you Marko.

    I thought cache worked this way:

    Cache preloaded
    Page is cached for all visitors
    Page / Post is changed > cache is recreated for that page

    So if I prime all my cache and then disable it, will the cache be regenerated when a post / product is updated?

    Thanks again!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stevecurrey

    Yes, it will be regenerated once the Page is visited and if Cache Preload is disabled.
    With Cache preload enabled, once Page / Post is changed the Prelad will start from that page.
    Thanks!

    Thread Starter stevecurrey

    (@stevecurrey)

    Thank you, Marko.

    I still don’t understand, unfortunately.

    Can you tell me how I would achieve the following:

    All pages preloaded and cached for my site
    Page cache updated when that particular page / post is updated.

    Apologies for my ignorance but I thought this was how page caching worked otherwise it’s just an endless cycle with no advantages from what I can make out.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stevecurrey

    Thank you for your question. No that is not how Cache Priming works.
    When enabled and when you configure it with 40 pages and the interval to 900 seconds, this means that every 15 minutes new 40 pages of your website will be cached. SO if for example, you have 2000 pages, your entire website will be primed in approx 12.5 hours.
    After that cycle is finished, the Coaching period will start again from the top. When the Page is updated or published, the preload will start again from that page and finish the cycle.
    What you are describing is that when the post is updated or published, the cache will be purged for that specific post and the page will be automatically cached. This is not how Cache Preload works.
    The advantage is that the visitors are always being served the fresh cached page, and once the Cache is purged, you don’t have to manually visit the page so it can be cached again.
    I hope this explains how Cache Preload works.
    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Primed Cache is not served (regenerated on each visit)’ is closed to new replies.