Content caching is used in many parts of Joomla CMS for speed-up of several tasks. For long-term good operation of page cache is necessary to take care at least for two processes :
- cache cleaning
- content recaching
Page cache cleaning
Cached items have expiration time. After this time the item is no more valid but usually remains in storage. For file cache is important to perform regulary cleaninig (garbage collection) to prevent storage overflow. In JotCache are available two different techniques for cache cleaning :
- autoclean - set as parameters in JotCache plugin which performs cleaning inside some visitor requests (it takes time max. 500 msec. in one request). Such method can be acceptable on sites with low request rate.
- clean cron job - using special PHP script started from web server cron with PHP CLI (Command Line Interface). Cron initiated cleaning is suitable for medium and large (heavy loaded) web sites. Problem can occur when PHP CLI is not installed on server of hosting company.
Each web page which is first time accessed or again accessed after its expiration time is fully processed on server. In such cases is no advantage of fast page loading from cache. Here are also several methods how to operate the cache :
- setting very long expiration time and page content is for such time 'frozen' in cache
- setting expiration time depending on time frequency of expected content changes and then using manual or automatic recache. Automatic recache can be initiated from web server cron with PHP CLI in regular time slots.
Automatic cache cleaning and recache in case when PHP CLI is not available (or cron job setting is found as difficult)
Starting of automatic runs for cache cleaning or caching can be also performed externally via HTTP(S) service when on web server are available runners serving as secure interface between external service and local cache processes. For JotCache ver.5.0 (Joomla 3.3) is now available new system plugin JotEasyCron for external cron service from EasyCron company.
Plugin JotEasy Cron allows to establish one cron job (track) for cache cleaning and three different cron jobs (they can operate in different time adjustments) for recache operation.
For each recache operation is possible to set page filter for selection which pages on the site have to be recached.