Skip to content

Commit 16aa18a

Browse files
committed
Extend CDN cache time
We had a very brief outage due to Scaleway issues, and this resulted in visible downtime because the cache time was too short. No real reason not to extend this, since we purge the cache on deploy anyway.
1 parent a1dd4ab commit 16aa18a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Caddyfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
try_files {path} /index.html
1010
file_server
1111

12-
# Cache responses for 1 minute, validate async during next 10 minutes, or
13-
# continue serving old data as-is for up to 24 hours if this server stops
14-
# responding/returns errors.
12+
# Cache responses for 1 minute (local)/1h (CDN - invalidated on deploy), validate async during the next 10
13+
# minutes, or continue using old data as-is for up to 24 hours if this server stops responding/returns errors.
1514
@get method GET
16-
header @get Cache-Control "public, max-age=60, stale-while-revalidate=600, stale-if-error=86400"
15+
header @get Cache-Control "public, max-age=60, s-maxage=3600, stale-while-revalidate=600, stale-if-error=86400"
1716

1817
header Content-Security-Policy "frame-ancestors 'none'"
1918
header Referrer-Policy "strict-origin"

0 commit comments

Comments
 (0)