I have Kirby cache enabled and I change the content of a page through the panel but after the update, still, the cached version of the page is loaded.
I thought then to add this kirby()->cache('pages')->flush() to the page.update:after hook I have inside config.php. I have the latest version of Kirby (3.4.3) and I used this code $this->cache('pages')->flush();
Cache should be cleared automatically for you when you update a page using the panel. No hooks or other extra code required. You can check if cache gets flushed if you look in the /site/cache-directory on the webserver.
Yes, I check the particular directory and nothing changes when I update a page all the files remain the same.
The only things that come to my mind and could probably cause a problem are that the site is multilingual and that I have installed Kirby through composer so maybe there is a permissions issue.
It’s actually the multilingual. When I update a page in English the cache is cleared but this doesn’t happen when I update a page in a different language.
I don’t know if this is related to the fact that I use different URLs for each language.
Actually, when I update a page in a different language the system clears the cache of the English cache pages directory.
Below the cache directory, there are subdirectories with the domain for each language as a name.
So weird. In my experience I have a site/cache directory, where there’s a pages subdirectory. Cached versions for each available page are saved like this: url-key.{language-code}.html.cache (e.g. home.fr.html.cache).
Upon each modification in the panel the pages-directory is cleared. And it gets regenerated as soon as there are active users on the website.
Just to be clear; in your case the *.{other then default language}.html.cache files persist in site/cache/pages/ upon changes via the panel?
Can you maybe share your languages and cache setup config?
Thanks for that. I never used this kind of setup. I’ld try to replicate it in the starterkit and if it doesn’t work as expected there neither, I’ld file a bug report on github.
Hi @zanstro, I think we’ve got lost in translation somewhere
I’m not gonna test it, I proposed if it was my problem I’ld try to replicate it. That’s where I tried to ask you to replicate it in a fresh starterkit as you know what the problem is and if it’s solved with it.