Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/caddy-cache-headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Add cache-control headers in Caddyfile for assets, service worker, and index.html
7 changes: 7 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

try_files {path} /index.html

# Content-hashed assets can be cached indefinitely — the filename changes on every build.
header /assets/* Cache-Control "public, max-age=31536000, immutable"
# Workbox SW must be revalidated on every load so the browser picks up updates.
header /sw.js Cache-Control "no-cache"
# index.html must not be cached so the browser always gets the latest app shell.
header /index.html Cache-Control "no-cache"

# Required for Sentry browser profiling (JS Self-Profiling API)
header Document-Policy "js-profiling"
}
Loading