Site cache
Site cache reduces the number of database queries needed for displaying a page by saving a snapshot of each page output. The snapshots are stored in the database table “cache” and consist basically of URL, site language and page HTML output.When are the snapshots saved
Cache record is saved on first page view by a user. Therefore the first view makes all queries specified by template and takes “normal” time. Next views of the same page are retrieved from cache using just couple of SQL queries.
How much does it speed up page views
In average it makes page generation 100 times faster.
Flushing cache
The whole cache is automatically flushed on three cases:
1. Any content object is saved or deleted.
2. Any admin page is saved.
3. XML or replication import is executed.
We delete all cache records because there are really no way for us to control about site logic in developer created templates: for example the site homepage might display content from various subsections where the data might change on XML import.
Configuration
To turn cache on: go to Admin > Properties > Site Properties and find value “Cache expires in X hours”. This sets the amount of time cache records are stored. This value defaults to 0 which means cache is not used.
Testing cache
Cache information is displayed in the site footer after you add string "?speed_debug=on" to your site URL. This sets cookie to your browser which forces site to display the following information:
1. Page generation time in seconds.
2. Information whether the cache is used displaying the page.
3. Number of queries executed by page display.
4. Number of total records in site cache table.
You might need to refresh the page before information in the footer is displayed. Note that since the cookie is stored only in your browser, the information is not displayed to other site visitors.
Use "?speed_debug=off" or restart your browser to get rid of this information in the site footer.
Limitations
Cache is not used whenever a user or editor has logged in. Since we cache whole pages you can not use it when any user-specific information is displayed using 3rd party applications or in case of random banners for example.
Related information
See also about page compression
RSS