Your Cache-Control Header Is Probably Wrong
no-cache does not mean do not cache. max-age on a CDN is not what you think. Here is what each directive actually does.
| Content | Header |
|---|---|
| Hashed JS, CSS, fonts | public, max-age=31536000, immutable |
| Unhashed images | public, max-age=86400 |
| HTML | public, max-age=0, s-maxage=60, stale-while-revalidate=300 |
| Public API, changes slowly | public, max-age=60, stale-while-revalidate=300 |
| Authenticated API | private, no-cache plus ETag |
| Anything sensitive | no-store |
| Redirects you might change | no-store, because a cached 301 is permanent and unfixable |
Published on debugly.dev by Rohit Bhadani | Founder of Krova Cloud