• Resolved blkpudd

    (@blkpudd)


    Hi,

    Is there any way to set the Page Cache Preload to also preload cache group content?

    Is there an easy way to check the Page Cache Preload is working and not simply cache pages being created by visitors?

    I am also trying to understand Page Cache expiry, the following are our current settings

    Website contains 1500 URLs in sitemap.
    Preload 900 seconds 30 pages,
    Garbage Collection Interval: 3600
    HTML Expires Lifetime: 3600

    I presume that the Expires Lifetime means that any Preload Page will become ‘garbage’ after 3600 seconds. Therefore our entire site will never be completely Preloaded. [Based on above settings, the max would be 120 pages preloaded at any one time]

    We don’t really want to increase the Expires Lifetime as 1 hour is about right for Browser caching for us – just in case the are errors on a page, or sale periods start/finish etc… However, we would really like to have page caching for the entire site (including mobile cache group), with expiry triggered separate to browser cache setting, or by manual purge. Is this possible?

    Thank you

    The page I need help with: [log in to see the link]

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

    (@vmarko)

    Hello @blkpudd

    Thank you for reaching out and thank you for your question.
    What the Cache preload does is:
    – 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 of the next run. That means that when the last page is reached, it will start from the beginning with the first 30 pages and so on.
    If your site is set to use wp-cron the default way, which only triggers on visits to your site. WP allows you to turn this off so u can trigger wp-cron.php manually via your system’s cron. When you do it that way the preload will run in batches on each cron job call to wp-cron. Check more info on this link
    With your current settings, your entire website should be preloaded in around 12 hours.
    You can also use wp cli for this wp w3-total-cache pgcache_prime
    So, instead of calling wp cron via crontab – you should call it directly via
    wp w3-total-cache pgcache_prime And since logging is available in WP CLI, you cab track the output which pages/sitemap positions are primed by script.

    The garbage collection interval comes in place when there are expired cached pages. So once preload starts from the beginning, the old pages will get the extension _old and will be deleted by Garbage collection interval.
    As for the HTML expires header lifetime, this is not related to cache priming. As you can see in the description, “Set the expires header to encourage browser caching of files.” it means that the fresh set of cached pages will be fetched every hour by the browsers.
    I hope this helps!
    Thanks!

    Thread Starter blkpudd

    (@blkpudd)

    Hi Marko,

    Thank you for your prompt reply and explanation.

    I have initiated the cron changes as per your suggestion. The only thing I am still curious about is preload cache groups. Should it be creating page cache for each cache group?

    Thank you.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @blkpudd

    You are most welcome.
    There is no need for preloading the cache per user agent.
    Most of the themes are now responsive so all cache created is the same for desktop and other user agents.
    Thanks!

    Thread Starter blkpudd

    (@blkpudd)

    Hi Marko,

    Thank you for your prompt reply.

    We are serving different images for mobile devices (mobile are portrait and desktops are landscape) so currently the cache groups are working well for us.

    Preloading page cache for cache groups would be a massive advantage for us. Can you offer any guidance on whether this can be achieved with CLI or possibly modifications to your plugin? If so, can you recommend any developers to assist?

    Many thanks.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @blkpudd

    You are most welcome.
    If you have enabled the User agent groups in Performance>cache Groups, the cache will be preloaded for user agents as well as for desktop.
    Thanks!

    Thread Starter blkpudd

    (@blkpudd)

    Hi Marko,

    I really don’t think Preload works with Cache Groups. I have triggered the preload via CLI, verified the pages being preloaded, then checked the FTP files and can confirm the main _index_ssl.html file is being created, but not the phones version.

    I have taken some screenshots, linked below:

    CLI output

    FTP Folder

    I would be grateful for any clarity on this issue.

    Thank you.

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

The topic ‘Page Cache Preload’ is closed to new replies.