Title: PreCache automatically
Last modified: January 14, 2021

---

# PreCache automatically

 *  Resolved [stephla](https://wordpress.org/support/users/stephla/)
 * (@stephla)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/precache-automatically/)
 * Hello,
 * I want to clean cache of pages and re-load them.
    I use automatically prime the
   page cache. I configure Update interval to 60 secondes (for test) and Garbage
   collection interval to 60 secondes too.
 * But the cache is never clean and pages never reload.
    So I tried to use plugin
   for cron and when I run w3_dbcache_cleanup and w3_minify_cleanup nothing happen.
   Cache is always the same.
 * How can I resole this problem please ?

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/precache-automatically/#post-13906974)
 * Hello [@stephla](https://wordpress.org/support/users/stephla/)
 * Thank you for your inquiry and I am happy to assist you with this.
    I am not 
   quite sure what your question is. Cache Preload, when set up properly, is using
   the sitemap to preload the set amount of pages E.G. 10 in a specific time period
   E.G. 900s 900s is set by default and lowering to 60s can use a lot of server 
   resources so you should leave it as it is to avoid this. Make sure to add the
   sitemap to the Sitemap URL field. wp_cron s 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 Cache Priming will automatically create an new
   and fresh set of cached pages. The expired (garbage) cache will be removed with
   Garbage collection interval. Again lowering the interval can cause a lot of server
   resources usage and may no perform as expected. Thanks!
    -  This reply was modified 5 years, 2 months ago by [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/).
 *  Thread Starter [stephla](https://wordpress.org/support/users/stephla/)
 * (@stephla)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/precache-automatically/#post-13907061)
 * Thanks for your response.
 * I have defined the sitemap.
    I don’t understand why the precache will work with
   cli and not work when I run the cron directly ?
 * There is an other way of wp-cli ? To work with cron
 * Thanks
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/precache-automatically/#post-13907539)
 * Hello [@stephla](https://wordpress.org/support/users/stephla/)
 * Thank you for your question.
    Simply, wp-cron is not reliable. This depends on
   how heavy your website is, the server condition, etc. In perfect conditions, 
   once the page is visited, the Preload should start and start preloading pages.
   You can set up custom corn on your server to visit your website every x minutes
   for example: `*/10 * * * * wget -q -O - http://www.example.com/ >/dev/null 2>&
   1` Thanks!

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

The topic ‘PreCache automatically’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/precache-automatically/#post-13907539)
 * Status: resolved