From 0c9c33d2f626c235ef24d9fabc723be11cd6088b Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 28 Jan 2025 22:20:26 +0000 Subject: put some cache-control on static/storage resources --- routes/static.php | 1 + 1 file changed, 1 insertion(+) (limited to 'routes/static.php') diff --git a/routes/static.php b/routes/static.php index 0944014..f28c7e4 100644 --- a/routes/static.php +++ b/routes/static.php @@ -11,6 +11,7 @@ Router::getInstance()->mount('/static/:path', function (array $args) { } $fileExtension = explode('.', basename($realPath)); $fileExtension = $fileExtension[count($fileExtension) - 1]; + header('Cache-Control: max-age=604800'); // 1 week header('Content-Type: ' . match ($fileExtension) { 'css' => 'text/css', 'js' => 'application/javascript', -- cgit v1.3