• Resolved diamantweb

    (@diamantweb)


    Hello Marko,
    I was tasked to keep a website always chached and prevent user to have to generate pages on-visit. Besically, I mean to use W3TC functions to set the right timing generating pages automatically. I have read something of sitemap that have to be uploaded to enable W3TC to generate pages automatically (pages indicated in simemap).

    If I am right, does it work every particular timeframe or there is a way to indicate a time when pages from the sitemap are automatically generated.

    I hope, I found the whole point right. If my description is not clear, please consider only my prime idea in the first sentence to do the task.

    Br, Waldemar

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

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

    (@vmarko)

    Hello @diamantweb

    Thank you for your inquiry and I am happy to assist you with this.
    Here are some general rules for Cache Preload:
    Example:
    You have 1000 pages.
    Update interval 900s (he number of seconds to wait before creating another set of cached pages.)
    Pages pr interval 10 (Limit the number of pages to create per batch. Fewer pages may be better for under-powered servers.)
    This means that 10 pages will be cached every 15 minutes so your entire website will be cached in 25hrs, You can, of course, adjust these settings and reduce the update interval or increase the pages per interval. this is entirely up to you but take note that this may increase the usage of server resources.
    The preload based on wp cron so it doesn’t work when you don’t have WordPress-handled requests. It would be a good idea to add define(‘DISABLE_WP_CRON’, true); and Once this is done, you should create a custom cron job that will call wp-cron.php at a set interval.
    Make sure sitemap file is set and contains URLs
    If you don’t want to rely on wp-cron – use wp-CLI command for preloading and Unix cron
    wp w3-total-cache pgcache_prime
    Thank you!

    Thread Starter diamantweb

    (@diamantweb)

    Hey Marko,
    I am appreciate your response.

    define(‘DISABLE_WP_CRON’, true); seems to have beed added in the config file. Would you pls suggest me a guide of how to manage adding a cron rule. I mean this: ” … and Once this is done, you should create a custom cron job that will call wp-cron.php at a set interval.”

    Should I use a tool, that is a plugin or some alternative?

    Waldemar

    Thread Starter diamantweb

    (@diamantweb)

    Hello Marko,
    I added a line to deactivate wp cron job and set cron job in admin panel every 15 minutes. Nevertheless, the pages are cached once it is visite, I rechecked it several times. It means above mentioned cahnged are not being applied ..

    On the cron job section in admin I added the folowing line. It is being executed every 15 min: wget -q -O – https://dev1.cossmeta.online//wp-cron.php?doing_wp_cron >/dev/null 2>&1

    Waldemar

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @diamantweb

    You should try using the wp cli wp w3-total-cache pgcache_prime
    so insnstead 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.
    Thank you!

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

The topic ‘Cache preload’ is closed to new replies.