release-cloudflare-worker icon indicating copy to clipboard operation
release-cloudflare-worker copied to clipboard

Better caching directives

Open flakey5 opened this issue 1 year ago • 2 comments

We're serving mostly static and immutable content, but only caching it for 1 or 4 hours (depends on cache type) for successful responses.

I think we should change this so that content that doesn't change (i.e. release assets) are cached for a lot longer than assets that do change (i.e. some directories, index.json).

Specifically, I think they should be something like these:

  • for immutable content (release assets, metrics, ...), public, immutable, max-age=31536000, s-maxage=31536000
  • for the things that do change (index.json, directory listings, ...), public, max-age=86400, s-maxage=86400, must-revalidate

flakey5 avatar Nov 01 '24 12:11 flakey5

cc @ovflowd

flakey5 avatar Nov 17 '24 18:11 flakey5

Those constraints seem good enough. @nodejs/web-infra any extra thoughts?

ovflowd avatar Oct 16 '25 20:10 ovflowd