Chapter 8. How-to Guides

Keep the Page Cache Warm with Recache Pro

After the cache is cleared, the first visitor to each page waits while the page is built and optimized again. Recache visits your pages for you, following links from a starting page, so the cache is already full when real visitors arrive. Run it after clearing the cache, or on a schedule.

To run it once, click Recache in the dashboard's Utility Tasks. The Recache Settings on the General tab control where it starts (Base URL, by default your home page; an HTML sitemap is a good alternative), how many pages it visits (Crawl limit), how many at once (Concurrency) and how many links deep it goes (Maximum depth).

To run it on a schedule:

Joomla
  1. Go to System → Manage → Scheduled Tasks and click New.

  2. Choose JCH Optimize - Recache.

  3. Give the task a title, choose how often it runs (for example, daily at night), and optionally override the base URL, crawl limit, concurrency and depth. Leave Delete cache first off unless you want a completely fresh cache on each run.

  4. Save.

Figure 8.8. A Recache scheduled task in Joomla
The Joomla scheduled task form for JCH Optimize - Recache, with its schedule and options.

Joomla's scheduler runs tasks when your site has visitors, unless you set it up to run from your server's CRON. You can also run Recache from CRON directly with the jchoptimize:recache command.

WordPress

On the settings page, General tab, Recache Settings section, choose when Recache runs in Recache frequency: On save only (the default, after you save the settings), Hourly, Twice Daily or Daily, or Disabled. Save. Delete cache chooses whether the cache is cleared before each crawl. WordPress runs scheduled jobs (WP-Cron) when your site has visitors.

Figure 8.9. The Recache settings in WordPress
The Recache Settings section of the General tab with the Recache frequency list.

Note

Recache needs to know your site's address. If it can't work it out, enter it in Base URL, or set $live_site in Joomla's configuration.php.