-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Set Expires
header when caching responses
#2182
Set Expires
header when caching responses
#2182
Conversation
Browsers are rather smart, but also dumb. This uses the `Expires` header alongside `cache-control` to better prompt the browser to actually cache. Unfortunately, firefox still tries to "race" its own cache, in an attempt to respond to requests faster, so still ends up making a bunch of requests which could have been cached. Doesn't appear there's any way around this.
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
Looks good indeed. But do we really need an extra crate for this?? |
It's already depended on by |
@BlackDex I've written my own implementation, which seems to work as expected. I'm not entirely convinced it's better, as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to not have one more dependency
Thanks, we can keep it this way, if it causes issues we can consider adding that dependency back. |
Browsers are rather smart, but also dumb. This uses the
Expires
headeralongside
cache-control
to better prompt the browser to actuallycache.
Unfortunately, firefox still tries to "race" its own cache, in an
attempt to respond to requests faster, so still ends up making a bunch
of requests which could have been cached. Doesn't appear there's any way
around this.
See also #1453 (comment)