[PR #1545] [MERGED] Client caching #2833

Closed
opened 2025-11-07 07:55:53 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1545
Author: @RealOrangeOne
Created: 3/27/2021
Status: Merged
Merged: 3/28/2021
Merged by: @dani-garcia

Base: masterHead: icon-client-cache


📝 Commits (3)

  • b22564c Cache icons on the client
  • 131348a Add immutable caching for vault assets
  • 6209e77 Icons should always be cached using full TTL

📊 Changes

2 files changed (+11 additions, -7 deletions)

View changed files

📝 src/api/icons.rs (+2 -2)
📝 src/util.rs (+9 -5)

📄 Description

Cache icons on the client too, to reduce requests when loading the homepage.

Caching without immutable will still issue requests, and because Rocket doesn't support conditional GETs, it's basically like not caching at all.

This also caches vault static files, which are cachebusted anyway so updates will still work fine. I've not changed the / route for this reason.

Bitwarden upstream doesn't do these, but they also use cloudflare for a CDN which makes this far less of an issue. For home users who don't use a global CDN, this should make quite a difference!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/1545 **Author:** [@RealOrangeOne](https://github.com/RealOrangeOne) **Created:** 3/27/2021 **Status:** ✅ Merged **Merged:** 3/28/2021 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `icon-client-cache` --- ### 📝 Commits (3) - [`b22564c`](https://github.com/dani-garcia/vaultwarden/commit/b22564cb000febe9a871f2121d96993ff5569c7b) Cache icons on the client - [`131348a`](https://github.com/dani-garcia/vaultwarden/commit/131348a49fd94f3fd63758c8419e70968464d4a0) Add immutable caching for vault assets - [`6209e77`](https://github.com/dani-garcia/vaultwarden/commit/6209e778e59c44d38288579a105c9e46c829c405) Icons should always be cached using full TTL ### 📊 Changes **2 files changed** (+11 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/api/icons.rs` (+2 -2) 📝 `src/util.rs` (+9 -5) </details> ### 📄 Description Cache icons on the client too, to reduce requests when loading the homepage. Caching without `immutable` will still issue requests, and because Rocket doesn't support conditional GETs, it's basically like not caching at all. This also caches vault static files, which are cachebusted anyway so updates will still work fine. I've not changed the `/` route for this reason. Bitwarden upstream doesn't do these, but they also use cloudflare for a CDN which makes this far less of an issue. For home users who don't use a global CDN, this should make quite a difference! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-07 07:55:53 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#2833