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

Should use Cache-Control: no-cache instead of no-store when etag option is true #90

Closed
yyx990803 opened this issue Dec 7, 2020 · 4 comments

Comments

@yyx990803
Copy link

yyx990803 commented Dec 7, 2020

When using

sirv(dir, { dev: true, etag: true })

The etag will be effectively useless because in dev mode the Cache-Control header is set to no-store, which causes Chrome to not include If-None-Match when requesting the file again.

I would suggest using no-cache instead when etag is enabled so that we can leverage 304 even in dev.

@lukeed
Copy link
Owner

lukeed commented Dec 7, 2020

Thanks Evan :) Overlooked that.

@lukeed lukeed closed this as completed in c8fe11b Dec 7, 2020
@lukeed
Copy link
Owner

lukeed commented Dec 7, 2020

Available in 1.0.10

@yyx990803
Copy link
Author

Thanks that was fast!

@lukeed
Copy link
Owner

lukeed commented Dec 7, 2020

You gave a full explanation – and it was easy 😉

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

No branches or pull requests

2 participants