Iām running the latest version of Kirby, 3.0.3. Whenever I save anything in the panel, it falls back to a cached version of the page while the content file gets edited correctly. Iāve tried to reĆÆnstall kirby and remove all plugins temporarily without result.
The only way to work in the panel currently is by having inspector opened with ādisable cacheā enabled.
What could be the cause of this?
Gave it a try, but doesnāt work.
I have similar problem after setting browser cache in my .htaccess file (I followed this guide).
Iām using similar htaccess caching settings. The issue persists though after commenting the settings.
I have to say that I canāt think of more pointers - seems like it is really connected to your server setup.
Iām running into this myself now. Content is only updated when dev tools is open and caching disabled.
Any chance your server is emitting Cache-Control
headers? Or, if youāre behind a CDN that automatically caches pages, are you making sure api/panel requests are not being cached?
For example, I emit Cache-Control
headers like this so Cloudflare knows what to cache and what to not.
'hooks' => [
'route:before' => function ($route, $path, $method) {
$kirby = kirby();
$query = Url::query() ?: '';
$response = $kirby->response();
$shouldCache = 'GET' === $method
&& $kirby->option('cache.pages.active')
&& !Str::startsWith($path, 'api', true)
&& !Str::startsWith($path, 'panel', true)
&& !Str::contains($query, 'token=', true);
if ($shouldCache) {
$response
->header('Cache-Control', 'max-age=1800, must-revalidate') // 30 minutes (60 * 30)
;
}
else {
$response
->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->header('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT')
;
}
}
],
But if youāre setting headers in your Apache/Nginx config, then youāll probably want to make adjustments there.
@neildaniels Ah, thanks, that reminded me that I had actually set Expires HTTP headers in my .htaccess recently for testing and completely forgotten about it . All good now.
Updated troubleshooting guide.