Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Make use of more HTTP caching headers #17

Open
ldesgoui opened this issue Jul 31, 2021 · 1 comment
Open

Suggestion: Make use of more HTTP caching headers #17

ldesgoui opened this issue Jul 31, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ldesgoui
Copy link

Hello,

It seems like HTTP caching headers could score you some very cheap, significant wins.

I saw Cache-Control already returns immutable, I think you could probably push that to public, max-age=31536000, immutable, as well as providing ETag, Last-Modified and Expires.

There are more cases where those can be returned as well, I think that any response for which a NAR was successfully fetched, so directory listing, redirects, but also 404s when a file was not found.

MDN has a great resource about this: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching

Pretty cool project!

Bests

@ldesgoui ldesgoui added the enhancement New feature or request label Jul 31, 2021
@zimbatm
Copy link
Member

zimbatm commented Jul 31, 2021

I don't plan on doing this immediately but that's a good idea. I thought that all modern browsers supported immutable. It looks like only Firefox and Safari do at this point in time; https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#browser_compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants