Add cache headers for static content

Reduces active connections requirement by instructing browsers not to revalidate ETags for a month
This commit is contained in:
celestora 2023-01-08 15:12:36 +02:00 committed by GitHub
parent aa05e8135d
commit 68a9a05965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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);