In the previous article Caching strategies for the Kreatio CMS: 1. Introduction, we had seen how caching is implemented in the Kreatio CMS.
As we saw there, a caching strategy is only as effective as how efficiently we can expire the cache. Otherwise, we will be left with unhappy writers and readers. Readers who are unhappy at being served stale content, and writers, unhappy because their content does not appear on the site soon enough.
When content is changed, the cached content has to be purged or regenerated. As we saw in the last section, we are separately caching the entire page as well as components present within the page. So, components and pages both have to expire when the content changes.
There are two different approaches to purge stale cache - event based cache expiry or time based cache expiry.
As the name suggest, the cache is expired on specific events.
Thus, whenever an article is created or updated, the corresponding article page cache and components cache gets purged.
If any changes were done to the Ranked List / Curated List it will purge that corresponding component and page.
Any changes done to the static pages will purge the cache of the corresponding page.
The benefits of caching will be lost if large amounts of cache are purged frequently. So we cannot rely only on event based cache expiry, particularly in a site where content is regularly updated. Thus, only those parts of the page where it is critical to update immediately like home page, latest articles component, article page etc. will be updated immediately using event based cache expiry. For other pages, the Kreatio CMS uses time based expiry.
Here, all cached content is expired after a specific period. While doing this, we have to make sure that all the cached content should not be expired at the same time. If you do this, it will lead to a sudden increase of requests to your application server and thus, the purpose of caching is lost.
Our caching algorithms ensure that page cache is expired in varying frequencies based on the importance, readership and age of each page. Thus, for the home page, cache is expired more frequently than for a page that has been published a while back and is no longer read frequently. The Kreatio framework has checks and balances to ensure that not all the article pages are expired at the same time, so as to avoid a sudden increase of requests to the application server.
In spite of the best of cache expiry plans, there would still be times when the publisher needs to expire the cache of a page, on demand. The Kreatio CMS provides facilities for this also. The system administrator can select a specific page and expire its cache instantaneously, if required.
Thus, the Kreatio CMS provides a robust caching and cache expiry mechanism to meet the needs of modern digital publishing.
Years back, there was this big debate about total cost of ownership (TCO). This was about software. The argument was that you considered initial costs when choosing software. But the total cost over years of maintaining it is much higher! The debate at that time was on which software had the cheapest lifetime costs. That debate died down after some time and everything settled back to normal. But it brought awareness that software costs much more than its one-time cost. Today, no one writes their own CRM or ERP systems. Most software has moved to a licensed model. This makes the lifetime cost...