From: Lady Date: Sat, 16 Dec 2023 22:36:14 +0000 (-0500) Subject: Add Cache-Control header to sample Caddyfile X-Git-Tag: 0.3.2~2 X-Git-Url: https://git.ladys.computer/x_status_git/commitdiff_plain/3b743898578b26b6a835c3e012eccccd6ea665f2 Add Cache-Control header to sample Caddyfile Basic functionality depends on recent versions of files, although the fact that every status needs to request the same base index implies that some level of cacheing is desirable. A cache of one hour is a good compromise; indices are unlikely to need to be refetched within a single session, but are likely to be updated between sessions. For IRI lookups, always consider the file stale to ensure that these redirects always “work”. --- diff --git a/Caddyfile b/Caddyfile index a430aae..95fed0e 100644 --- a/Caddyfile +++ b/Caddyfile @@ -36,6 +36,7 @@ status.site.example { handle @iri { handle @bare { rewrite * /.lookup.xhtml + header Cache-Control max-age=0 } handle @slash { @@ -152,7 +153,10 @@ status.site.example { } } - header Access-Control-Allow-Origin "*" + header { + Access-Control-Allow-Origin "*" + ?Cache-Control max-age=3600 + } file_server { index index.xml index.xhtml index.html index.rdf index.txt