Hello @stevenmaas
Thank you for reaching out and I am happy to help!
I would advise using wp-cli and calling wp w3-total-cache pgcache_prime [--start=<start>] [--limit=<limit>]
It’s not recommended to prime all pages at once (depending on the size of the website) and you should also enable cache priming in Performance>Page Cache and add the sitemap URl
I hope this helps!
Thanks!
That works great!
In Plesk I have the option to run a command with WP toolkit. The below will purge and (&&) prime the cache with 50 pages…
/usr/sbin/plesk ext wp-toolkit –wp-cli -instance-id 9 — w3tc flush posts –skip-plugins=false && /usr/sbin/plesk ext wp-toolkit –wp-cli -instance-id 9 — w3-total-cache pgcache_prime –limit=50 –skip-plugins=false
This works great for small sites (under 50 pages) once a day with html cache set at 84600 (1 day). For larger sites I set up the same 2 commands separately 1 to purge 1 to prime several times so the script doesn’t exceed the 180 second timeout. The 50 page limit appears to work in under the 180 seconds.
Is there a way to perform the rest of the W3TC events such as cleanup using wp commands? If there is a page where all your wp commands are please let me know! Also, what is the recommended order to run the commands: Purge, Prime, Cleanup?
For example I would like to perform all of what W3TC needs to do daily in one command string. Purge, Prime, Cleanup etc. This way I can set an early cron when my sites are slow (early morning).
I have cron disabled in WordPress and use Plesk Cron on the sites to run cron Jobs. Right now W3TC events are queued in the WordPress cron until Plesk runs the cron. I could bypass queuing the events altogether with a single command.
-
This reply was modified 1 year, 5 months ago by
steven.m.
-
This reply was modified 1 year, 5 months ago by
steven.m.
-
This reply was modified 1 year, 5 months ago by
steven.m.
-
This reply was modified 1 year, 5 months ago by
steven.m.
Hello @stevenmaas
Glad to know this works for you
Let me address other questions in the other topic you opened as there is no need to doplicate answers
Thanks!