[PR #3751] [MERGED] Optimized Favicon downloading #2938

Closed
opened 2025-10-09 18:14:13 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3751
Author: @BlackDex
Created: 8/4/2023
Status: Merged
Merged: 8/13/2023
Merged by: @BlackDex

Base: mainHead: optimize-icon-fetching


📝 Commits (1)

  • 6cdcb3b Optimized Favicon downloading

📊 Changes

2 files changed (+116 additions, -108 deletions)

View changed files

📝 Cargo.toml (+1 -1)
📝 src/api/icons.rs (+115 -107)

📄 Description

Some optimizations in regards to downloading Favicon's.

I also encounterd some issues with accessing some sites where the connection got dropped or closed early. This seems a reqwest/hyper thingy, https://github.com/hyperium/hyper/issues/2136. This is now also fixed.

General:

  • Decreased struct size (reduces memory usage)
  • Decreased memory allocations (faster HTML parsing)
  • Optimized tokenizer a bit more to only emit tags when all attributes are there and are valid.

reqwest/hyper connection issue:
The following changes helped solve the connection issues to some sites. The endresult is that some icons are now able to be downloaded always instead of sometimes.

  • Enabled some extra reqwest features, deflate and native-tls-alpn (Which do not bring in any extra crates since other crates already enabled them, but they were not active for Vaultwarden it self)
  • Configured reqwest to have a max amount of idle pool connections per host
  • Configured reqwest to timeout the idle connections in 10 seconds

🔄 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/3751 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 8/4/2023 **Status:** ✅ Merged **Merged:** 8/13/2023 **Merged by:** [@BlackDex](https://github.com/BlackDex) **Base:** `main` ← **Head:** `optimize-icon-fetching` --- ### 📝 Commits (1) - [`6cdcb3b`](https://github.com/dani-garcia/vaultwarden/commit/6cdcb3b2976be758987a36491d2da4ecccad941f) Optimized Favicon downloading ### 📊 Changes **2 files changed** (+116 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -1) 📝 `src/api/icons.rs` (+115 -107) </details> ### 📄 Description Some optimizations in regards to downloading Favicon's. I also encounterd some issues with accessing some sites where the connection got dropped or closed early. This seems a reqwest/hyper thingy, https://github.com/hyperium/hyper/issues/2136. This is now also fixed. General: - Decreased struct size (reduces memory usage) - Decreased memory allocations (faster HTML parsing) - Optimized tokenizer a bit more to only emit tags when all attributes are there and are valid. reqwest/hyper connection issue: The following changes helped solve the connection issues to some sites. The endresult is that some icons are now able to be downloaded always instead of sometimes. - Enabled some extra reqwest features, `deflate` and `native-tls-alpn` (Which do not bring in any extra crates since other crates already enabled them, but they were not active for Vaultwarden it self) - Configured reqwest to have a max amount of idle pool connections per host - Configured reqwest to timeout the idle connections in 10 seconds --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 18:14:13 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2938