lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.07k stars 58 forks source link

cache cannot be stale #99

Closed hokamc closed 3 years ago

hokamc commented 3 years ago

After building svelte app, i try to serve site with sirv.

sirv public --quiet --etag --maxage 31536000 --immutable --gzip

However, I am facing a problem that cache cannot be stale after I change svelte code and rebuild again. p.s. I test it in a firefox.

In my observation, etag has been updated and only bundle.js has the problem of cache.

hokamc commented 3 years ago

just remove immutable ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

lukeed commented 3 years ago

Yes, immutable directive means that the contents at a given URL will never change. It should only be used in production, with filenames containing a content-based hash in the filename.