• Resolved rashkoff

    (@rashkoff)


    Hello,

    I want to ask which is the best way to have cache pre-load with woocommerce.
    I’m notice that the W3TC don’t work always.
    The store has 2000 URL in xml sitemap
    My idea is to clean the cache by night and make the preload.
    Can you give me some tips how to do all of this?
    Thanks
    Ricky

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

    (@vmarko)

    Hello @rashkoff

    Thank you for your inquiry and I am happy to assist you with this.
    You can use recommended settings in the Cache Preload. It would be a good idea to disable define(‘DISABLE_WP_CRON’, true); and Once this is done, create a cron job that will call wp-cron.php at a set interval
    As for the cache lifetime, if for example, you have 2000 pages that you want to be preloaded and you are using the default settings, 10 pages per 900s which means that all of the pages will be preloaded in 50 hrs. but since you want the entire website to be preloaded in 24 hrs you should either increase the number of pages per interval or decrease the interval of 900s to the number of seconds/minutes that will accomplish this.
    Please note that this may cause a huge server load.
    As the page is cached only when visited (without the priming) Cache preload may help to cache all pages.
    You should 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 track the output which pages / sitemap positions are primed by script
    Thank you!

    Thread Starter rashkoff

    (@rashkoff)

    Hello @vmarko

    Thanks for the reply

    The site is on VPS and the average preload for page is 4s.
    So 2000 * 5s = 10000 / 60 / 60 = almost 3 hours

    I’m not familiar with wp cli

    I can call any cron job using Cpanel

    My request is to automatize the process:
    1. every night to call a cron job which purge all the cache and then rebuild.
    2. disable all option which automatic clean the cache (Purge policy: Page cache is all disable)

    Where should I looking for this plan?

    Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rashkoff

    What do you mean by “average preload for page is 4s.”?
    Thanks!

    Thread Starter rashkoff

    (@rashkoff)

    Hi,
    I’ve made some test with other plugins and to preload 1 page tooks 4s

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rashkoff

    This is unrelated to the cache preload in W3 Total Cache.
    If you want to use corn on your server, you should set the corn to the desired interval for the selected bulk of pages, for example, 10 pages every 10 minutes. When preload finishes the next 10 pages will be preloaded after 10 mins.
    As for clearing the cache, you can also set up a corn job and call w3tc_flush_all()
    For assistance with the corn jobs please reach out to your host for assistance.
    Thank you!

    Thread Starter rashkoff

    (@rashkoff)

    Hi,
    do you have a php template which I can edit with my website and then I call the php file form cpanel cron job with wget?

    Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rashkoff

    No, we do not have a PHP template for this.
    But you can check the w3-total-cache-api.php in wp-content/plugins/w3-total-cache where you can check the functions dor purging and clearing the cache.
    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘preload cache’ is closed to new replies.