One of the most difficult things of using Kirby for large websites is how “barebones” the default cache mechanisms are, as any change in the page means to invalidate all the cache, and there is no easy way to partially invalidate it.
An example:
If I have a blog with 1000 pages, I rather not want to invalidate all 1000 pages on any change (even a draft change) but only the changed page and the overview pages.
Right now, the only way is to use a separate plugin (like kirby-lapse) and cache parts of the site like that.
The pages cache gets cleared on every change in the panel. Since pages can include parts of other pages it’s hard to determinate which pages should be cleared.
You can create additional caches without a plugin:
$cache = kirby()->cache('articles');
$key = 'article-'. $page->uid();
$article = $cache->get($key);
if($article == null){
$article = snippet('article', [], true);
$cache->set($key, $article, 24 * 30 * 6);
}
You’ll just have to clear the cache yourself – for example in a hook:
kirby()->cache('articles')->flush();
Exactly - but other CMS either track which pages their pages are used in, or have a good amount of config options to customize this. Also with that approach, you e.g. can’t control staticache or other customized providers. It’d really be great to have such a customizable flushing behaviour which e.g. a CDN plugin could hook into for page validation.