From 23716ff729293e8f7b3e6e82d1d6f526dbd261ba Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 5 Oct 2020 11:16:17 +0300 Subject: [PATCH] Do not cache 404 [#3025] --- system/pages/notfound.md | 1 + system/src/Grav/Common/Grav.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/pages/notfound.md b/system/pages/notfound.md index ca7d3ded75..92286644a4 100644 --- a/system/pages/notfound.md +++ b/system/pages/notfound.md @@ -2,4 +2,5 @@ title: Not Found routable: false notfound: true +expires: 0 --- diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index c7287dbd6b..458fe16c6f 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -261,7 +261,7 @@ public function process() ); $default = function (ServerRequestInterface $request) { - return new Response(404); + return new Response(404, ['Expires' => 0, 'Cache-Control' => 'no-cache, no-store, must-revalidate'], 'Not Found'); }; /** @var Debugger $debugger */