Questions about Kirby file cache

My site was getting slow because of some heavy parsing stuff. I’m trying out the Kirby Cache. It works fine I just have some questions about it that I could not find any answers to in the docs.

1. When do cache refresh?

When does the cache refresh? On page save? On expire date? Something else?

2. Does it cache when logged in?

Does Kirby cache pages when I’m logged in to the panel? (on the front end)

Update - Answer

The answer is yes, it caches pages even if logged in.

3. Cache html timestamp?

Is there a nice way to write in the HTML a cache timestamp? like below?

<!-- Cached 2015-01-01 12:31 -->
2 Likes

The cache IDs are based on the page URI. But in case any page of the site has been modified (file modification date), the cache is flushed.

Yes, that’s true.

You can simply output the current date using the PHP date() function. It won’t be updated until the next time the page is not loaded from cache. :wink:

4 Likes

When a page is modified only that page cache is refreshed? What about pages that are used as an archive and list subpages that are dependent on the subpages? They will have the old cached data still?

No, it depends on the whole site. If any content file is modified, the whole cache gets invalidated. That’s why your templates that depend on other pages work as well.

2 Likes