• Resolved saens

    (@saens)


    Hi,
    I’m thinking of moving over to w3tc. Therefore I’m running tests.

    I’ve set the page cache pre-loader to run every 30sec and do 15 pages per batch. It’s called by a cron-job outside of WordPress, which calls site.com/wp-cron.php every 30sec.

    I have a total of 150 pages. I’d expect all pages to be cached after (150/15)*0.5 min = 5 minutes. I’m seeing a constant high server load however.
    (staging environment is completely seperate from production, so no load usually)

    I’d expect the pre-caching to stop after all pages are pre-cached and server load to drop down to near 0.

    The TTL of cache objects is set to 36000 seconds (=10hrs), so after 10 hours I’d expect to server load to once again go up for 5 minutes and then go down again.

    What am I missing?

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

    (@vmarko)

    Hello @saens

    Thank you for your inquiry and I am happy to assist you with this.
    There is no “Sleep when done” when it comes to cache preloading. The server load is caused because every 5 minutes all 150 pages are being cached all over again. Once the preloading is complete it starts from the beginning. This is simply how the cache priming works in W3 Total Cache.
    I would suggest that you use default values and cache 10 pages every 15 mins to avoid high sever load. This way your entire website will be cached in 4 hrs and every 4 hrs new, fresh cache will be served to the visitors.
    Thanks!

    Thread Starter saens

    (@saens)

    Thanks for your reply.
    I’m trying to understand what actually happens with what I am seeing.
    I’ve not changed my settings yet.

    1. w3tc just starts over when it has cached all pages, yes?
    2. what does w3tc do when it reaches the first page after starting over?
    overwrite or generate and throw away if TTL is not reached?

    I’m seeing a page which is more than 1 hour* old. And if what you’re saying is correct, then I should never see a page this old (with my current aggresive settings)

    *Served from: testest.nl @ 2021-01-25 00:16:19 by W3 Total Cache

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @saens

    Thank you for your question.
    1. Yes that is correct.
    2. It starts caching the page again.
    3. WHat you are seeing is the browser setting (expires header) and it means how long is the page cached in the browser and not on the server itself.
    THanks!

    Thread Starter saens

    (@saens)

    Thanks for your responses.

    Regarding 3). I always test in clean private windows. So I’d expect to always have a page served with a time-stamp < 1 hour. This is not the case.
    Local/browser cache shouldn’t be an issue because of the private window. Unless you mean something else with what you’re saying in 3.

    For clarity: I’m referring to the timestamp in the bottom HTML:

    <!–
    Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

    Paginacaching met redis

    Served from: testest.nl @ 2021-01-26 12:25:00 by W3 Total Cache
    –>

    • This reply was modified 5 years, 6 months ago by saens.
    Thread Starter saens

    (@saens)

    Also, regarding 2)

    I’ve been looking at my server logs and you’re saying “2. It starts caching the page again.”
    But this is simply not true. Also supported by what you’re saying here: https://wordpress.org/support/topic/page-cache-preload-doesnt-seem-to-stop/#post-11981646

    I’m seeing pages being served that are hours old and have been visited by w3tc warm-up many times in between.
    I’m seeing pages expiring (going cold) only to be warmed when the w3tc warm-up visits them. And with a low visit interval as you propose many pages go cold waiting to be hit by the w3tc warm-up and actually get refreshed.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @saens

    wp_cron is not very reliable when it comes to cache priming. So it’s better to use wp-cli And also logging is available in wp-cli .
    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 saens

    (@saens)

    My cron is triggered every minute by a server cron, independant of wordpress.

    My server logs show exactly what pages are being hit by w3tc cache warmup.

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

The topic ‘Pre-load page cache: sleep when done?’ is closed to new replies.