The cache system
5 February 2018 | 297 views
Tuskfish has two caching systems to speed up page loads:
- The image caching system generates thumbnails from the images uploaded with content objects, dynamically scaling and caching them at the size specified in the templates at run time. This ensures that, whatever the requirements of your site, images are automatically optimised to fit every page they are displayed on. You can edit the required image size in a template and Tuskfish will rebuild thumbnails for you at the new size automatically.
- The page caching system saves a copy of each page the first time it is loaded. Subsequent page loads return the cached copy, eliminating needless database calls and code execution. Where page contents vary according to parameters, a separate cache file is written for each combination of parameters.
Page caching is controlled via the site preferences, which consist of a simple on/off switch, and a field where you can set the expiry timer for cached content. The default cache lifetime is one week and you may wish to increase or decrease this to suit your circumstances.
You can clear the cache by clicking on the 'Flush cache' link in the admin section. The cache will also be cleared when you add, delete, edit or toggle content online/offline; this is to ensure that index pages and pagination controls are refreshed when the site content changes.
The page caching system is most useful on index pages where you are displaying multiple content items, and the benefit scales with the number of items you include on those pages. Frankly, it is of limited benefit when viewing a single content item, or an index page with only a few items, as Tuskfish is already very lean. But if you are displaying say 10 content items on a page, or if you are running a number of blocks, then you will see some performance gains.
Copyright, all rights reserved.