Commit d39dc39
Eric Bower
·
2026-01-16 21:35:18 -0500 EST
parent 98e7f62
refactor(pgs): cache-control max-age and revalidate We want to prevent the browser from caching stale static pages by requiring it to revalidate using ETag after 1 minute.
1 files changed,
+3,
-0
+3,
-0
| ... | ... | @@ -267,6 +267,9 @@ func (h *ApiAssetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
| 267 | 267 | } | |
| 268 | 268 | } | |
| 269 | 269 | ||
| 270 | + | // Default cache: short TTL then must revalidate using ETag | |
| 271 | + | w.Header().Set("cache-control", "max-age=60, must-revalidate") | |
| 272 | + | ||
| 270 | 273 | for _, hdr := range userHeaders { | |
| 271 | 274 | w.Header().Add(hdr.Name, hdr.Value) | |
| 272 | 275 | } |