From b06dbbe075ebc8c2a6ba6aca69c588d20ef453d1 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Wed, 2 Sep 2020 11:55:36 +0200 Subject: [PATCH] set cache control to 180 seconds for codeberg pages --- var/www/pages/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/www/pages/index.php b/var/www/pages/index.php index 6cf060d..a0def77 100644 --- a/var/www/pages/index.php +++ b/var/www/pages/index.php @@ -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'\"";