diff options
| author | winter | 2025-01-28 22:20:26 +0000 |
|---|---|---|
| committer | winter | 2025-01-28 22:20:26 +0000 |
| commit | 0c9c33d2f626c235ef24d9fabc723be11cd6088b (patch) | |
| tree | 6a3bf1d416f85272b8ed3c5b9d2c412534866e94 /routes/static.php | |
| parent | f7a6123c404b126fd550cbb29aec82c88613ce02 (diff) | |
put some cache-control on static/storage resources
Diffstat (limited to 'routes/static.php')
| -rw-r--r-- | routes/static.php | 1 |
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', |
