When is Cache getting flushed or how to ignore on template

At what points does the cache for a page get flushed?

I have a list template that just get and prints links of a collection of pages. When editing any of these linked subpages will the cache for the list be reset?

If not – how to exclude all pages with that template from my cache? getting them all using site()->index() and adding their URI to config using a for-loop seems wasteful. the cache.ignore-array can not handle template definitions, right?

actually i want to cache only all pages of one or two templates and ignore the rest (if editing subpages does not update the list).

Updating any page clears the full cache. So yes, it should be fine. :slight_smile:

seriously? that makes caching almost useless when content is created/update frequently. :sweat:

i have a customer with about 5k subpages and a dozend lists for filtering. i am fine with flushing the lists cache but when one of the 5k pages is updated all others are lost too. then its almost better to not cache at all.

is there any way for me to finetune this? writing a kirby component/extension?

Using Varnish instead of kirby’s cache might prove more useful in your situation. You can have kirby make a call to clear a subpage’s Varnish entry on a kirby hook.

just for getting 20 chars this is the link to Varnish.

thanks for the tip – but i do not have that much control over the web-server.

I used a hosting provider that had Varnish installed by default. It made the Kirby Panel not work but I guess it has to to with the Varnish settings.

Now I run another host without Varnish.

Well yeah if your Varnish instance just caches everything in a dumb way and you have no way to configure it it’s like shooting yourself in the foot.

Yes, caching is hard. Kirby’s cache is dumb in a good way, it rather caches less than having outdated pages in the cache. :slight_smile:
The Kirby page cache can currently not be configured based on page dependencies or templates etc. as that makes it all very complex and reduces the performance when updating content (there was a discussion about this in another castle topic).

Using some dedicated caching software like Varnish probably makes sense for larger sites.

In think you mean this one? Why is the cache so cryptic?

1 Like

Yep, thanks! :slight_smile: