Fixed proxy/browser caching issues in admin pages

This commit is contained in:
Matias Griese
2020-09-14 13:46:59 +03:00
parent af314f789d
commit 8b6679855c
29 changed files with 39 additions and 3 deletions

View File

@@ -451,6 +451,8 @@ class AdminPlugin extends Plugin
// Replace page service with admin.
$this->grav['page'] = function () use ($self) {
$page = new Page();
// Plugins may not have the correct Cache-Control header set, force no-store for the proxies.
$page->expires(0);
if ($this->grav['user']->authorize('admin.login')) {
@@ -467,6 +469,7 @@ class AdminPlugin extends Plugin
if (file_exists(__DIR__ . "/pages/admin/{$self->template}.md")) {
$page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$self->template}.md"));
$page->slug(basename($self->template));
return $page;
}