From 0812666fda3509ff38bdc0268c7848ec5090e039 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 4 Apr 2026 01:04:29 -0700 Subject: [PATCH] Add Cache-Control to response headers This header asks the requester to cache like this: 0-1 hour: serve cached page 1 hour-7 days: serve cached page and revalidate in the background 7 days+: get and serve fresh page (no cache) Not all web browsers (e.g., Google Chrome) will respect this header. It is mainly for CDNs or other layers I may decide to put in front of Caddy later. --- etc/caddy/Caddyfile | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index 7c1b8cc..cb4fc06 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -4,6 +4,7 @@ git.ardis.lu { Cross-Origin-Opener-Policy same-origin Cross-Origin-Embedder-Policy require-corp X-Content-Type-Options nosniff + Cache-Control "max-age=3600, stale-while-revalidate=604800, stale-if-error=604800" } root /usr/share/gitweb -- 2.47.3