How is the cache preloaded?
WP Rocket comes with two other great features : automatic and on-demand cache preload. These two features ensure that your pages are always cached. So your visitors or search engines bots won't have to generate the cache for the best user experience :)
We use dedicated crawlers hosted on our servers to preload your cache for a lower CPU footprint on your server, better compatibility, and the fastest crawl. The whole process is totally transparent to you.
The crawlers don't collect any information, they only simulate a visit to create the cache files.
Since WP Rocket 2.8, there is the possibility to preload your content using an XML sitemap. The advantage of this feature is that it will preload all the URLs in your sitemap file(s), and not only the homepage and the links found on it!
The sitemap feature is also not dependant on our bot, so if you had any trouble with too much load on your website and had to disable the preload bot, it will enable you to still benefit from the preloading.
The sitemap preloading can be launched from the admin bar menu or the Preload tab of WP Rocket. It will also automatically run when the lifespan of the Clear Cache Lifespan option expires.
Currently, the sitemaps generated from Yoast SEO, All in One SEO and Jetpack are automatically detected!
You can control the crawl interval to prevent server overload:
If you want to set custom intervals you can do that by using this helper plugin:
📥 Download (.zip): WP Rocket | Custom Sitemap Preload Intervals
Developers: You can find the code for this plugin on GitHub.
On Demand Preload
This is the second way to preload your cache. Click on the button "Preload Cache". Our bot will crawl your homepage and all the links found on your home.
When you write or update a new post/page, WP Rocket automatically clears the cache for this content and any other content related to it, (i.e. home, category, tag, pagination etc) and our bot will crawl these pages again to generate the cache.
Note: If you are using the "Clear Cache Lifespan" option to purge the cache on a regular basis, our bots will automatically rebuild the cache then as well.
Preloading at a specific time
If you want to make sure that this happens at a certain time every day, you can create a cron job (through your webhosting control panel) and launch one of these function at whatever time you want:
- Run the Preload Bot:
- Run the Sitemap Preload:
For further instructions, you can follow this guide for clearing the cache via cron, and just change the called function.
If you have 3rd party content on your website (for example fonts loaded from Google Fonts or a video from Youtube), you may want to add its origin domain to the DNS prefetch option. It can be a minor boost to your loading time, since the DNS resolution will have already been made when requesting the external resources. You can watch this video to learn how to use the option: http://www.youtube.com/embed/jKMU6HgMMrA