aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/static.php
diff options
context:
space:
mode:
authorwinter2025-01-28 22:20:26 +0000
committerwinter2025-01-28 22:20:26 +0000
commit0c9c33d2f626c235ef24d9fabc723be11cd6088b (patch)
tree6a3bf1d416f85272b8ed3c5b9d2c412534866e94 /routes/static.php
parentf7a6123c404b126fd550cbb29aec82c88613ce02 (diff)
put some cache-control on static/storage resources
Diffstat (limited to 'routes/static.php')
-rw-r--r--routes/static.php1
1 files changed, 1 insertions, 0 deletions
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',