mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 17:23:04 +03:00
[PR #2182] [MERGED] Set Expires header when caching responses
#3296
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/2182
Author: @RealOrangeOne
Created: 12/28/2021
Status: ✅ Merged
Merged: 12/30/2021
Merged by: @dani-garcia
Base:
main← Head:cache-expires-header📝 Commits (4)
4584cfeAdditionally set expires header when caching responses248e7daCollapse field name definition690d0edAdd our own HTTP date formatter6ddbe84Remove unnecessary return📊 Changes
3 files changed (+84 additions, -40 deletions)
View changed files
📝
src/api/icons.rs(+7 -2)📝
src/api/web.rs(+28 -25)📝
src/util.rs(+49 -13)📄 Description
Browsers are rather smart, but also dumb. This uses the
Expiresheaderalongside
cache-controlto 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 https://github.com/dani-garcia/vaultwarden/issues/1453#issuecomment-1002115973
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.