set cache control to 180 seconds for codeberg pages

This commit is contained in:
Andreas Shimokawa 2020-09-02 11:55:36 +02:00
parent cb590c7568
commit b06dbbe075
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ if (array_key_exists($ext, $mime_types)) {
header("Content-Type: application/octet-stream");
}
header("Cache-Control: public, max-age=180, immutable");
## We are executing command twice (first for send_response-checking, then for actual raw output to stream),
## which seems wasteful, but it seems exec+echo cannot do raw binary output? Is this true?
$command = "sh -c \"cd '$git_root' && /usr/bin/git show 'HEAD:$file_url'\"";