Exclude a virtual (plugin) page from cache

I’m defining a virtual page in a plugin. I’d like to always exclude that page from the pages cache, regardless of global config.php settings. Is this possible? It seems you can’t set a global ignore from with a plugin…

Hm, maybe you can remove the element from the cache before it is loaded: https://github.com/getkirby/kirby/blob/3.2.3/src/Cache/FileCache.php#L131

I could. Or I could create a custom page model for my virtual page and override the isCacheable() method to always return false. That seems to be the best option for now.

:+1:

… except that I can’t get a my virtual page to use my custom page model. :thinking:

Solved. Returned my virtual page with new Page() so of course the custom model wasn’t working.