Check if a page is cached?

Is it possible from let’s say a plugin to check if a page is cached (file cache) or not? How?

Something like this

if( is_cached() ) echo 'Page is cached';

Hmmm, wild guess, but maybe something like this:


if(kirby()->cache()->exists($page->cacheId()))

or as in another core file it is used (not sure which works):

if(kirby()->cache()->exists(md5(url::current())))

I did not get any of them to work.

As a sidenote a totally spammed your Github today:

Bastian made a comment about cacheId() here https://github.com/getkirby/kirby/issues/263