From 68a9a05965f6abf531f3d12dabcf103e5268e5ce Mon Sep 17 00:00:00 2001 From: celestora Date: Sun, 8 Jan 2023 15:12:36 +0200 Subject: [PATCH] Add cache headers for static content Reduces active connections requirement by instructing browsers not to revalidate ETags for a month --- chandler/MVC/Routing/Router.php | 1 + 1 file changed, 1 insertion(+) diff --git a/chandler/MVC/Routing/Router.php b/chandler/MVC/Routing/Router.php index 52d4fa8..b6e0e6c 100644 --- a/chandler/MVC/Routing/Router.php +++ b/chandler/MVC/Routing/Router.php @@ -193,6 +193,7 @@ class Router header("Content-Type: " . system_extension_mime_type($file) ?? "text/plain; charset=unknown-8bit"); header("Content-Size: " . filesize($file)); + header("Cache-Control: public, must-understand, immutable, max-age=628000000"); header("ETag: $hash"); readfile($file);