[PR #14420] [CLOSED] Add 2nd level cache for DB queries #13982

Closed
opened 2026-02-07 07:22:21 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14420
Author: @Shadowghost
Created: 7/4/2025
Status: Closed

Base: masterHead: 2nd-level-cache


📝 Commits (7)

  • f0d6ef9 Activate 2nd level EFcore cache
  • c657bea Use CacheManager
  • 2f85f04 Use faster BondCompactBinary serializer
  • 1c997f5 Fix Newtonsoft
  • 0df0b50 Make the second level cache interceptor rw
  • 5bfed56 Use Bitfaster.Caching for EFSecondLevelCache
  • 23451ee Remove SecondLevelCacheInterceptor from interceptors

📊 Changes

6 files changed (+405 additions, -5 deletions)

View changed files

📝 Directory.Packages.props (+3 -2)
📝 Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs (+18 -1)
src/Jellyfin.Database/Jellyfin.Database.Implementations/Cache/EFCacheProvider.cs (+92 -0)
src/Jellyfin.Database/Jellyfin.Database.Implementations/Cache/JellyfinSecondLevelCacheInterceptor.cs (+290 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs (+0 -2)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Jellyfin.Database.Implementations.csproj (+2 -0)

📄 Description

Since we're now fully on EFcore, let's try this again

Changes

  • Add 2nd level cache
  • Use CacheManager Bond Serializer (Benchmark)

Comments

  • This increased UI responsiveness immensly for me
  • So far I haven't encountered any issues

🔄 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/jellyfin/jellyfin/pull/14420 **Author:** [@Shadowghost](https://github.com/Shadowghost) **Created:** 7/4/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `2nd-level-cache` --- ### 📝 Commits (7) - [`f0d6ef9`](https://github.com/jellyfin/jellyfin/commit/f0d6ef9b20c9239a6ebba8a9e2ff870f90bfbe43) Activate 2nd level EFcore cache - [`c657bea`](https://github.com/jellyfin/jellyfin/commit/c657bea72da25d7a076bddcc81d4b631ab934526) Use CacheManager - [`2f85f04`](https://github.com/jellyfin/jellyfin/commit/2f85f044cbc316d4d40c39440313b14986d4d307) Use faster BondCompactBinary serializer - [`1c997f5`](https://github.com/jellyfin/jellyfin/commit/1c997f5d7ca14b10fc632fc30ae7312725ab311c) Fix Newtonsoft - [`0df0b50`](https://github.com/jellyfin/jellyfin/commit/0df0b505ce22c8db550d4b07071107fee347de7e) Make the second level cache interceptor rw - [`5bfed56`](https://github.com/jellyfin/jellyfin/commit/5bfed566356b2145a65fe961640c03848dc12ba4) Use Bitfaster.Caching for EFSecondLevelCache - [`23451ee`](https://github.com/jellyfin/jellyfin/commit/23451ee463535699b6750f6f1f3c92dd357166b3) Remove SecondLevelCacheInterceptor from interceptors ### 📊 Changes **6 files changed** (+405 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `Directory.Packages.props` (+3 -2) 📝 `Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs` (+18 -1) ➕ `src/Jellyfin.Database/Jellyfin.Database.Implementations/Cache/EFCacheProvider.cs` (+92 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Implementations/Cache/JellyfinSecondLevelCacheInterceptor.cs` (+290 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs` (+0 -2) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Jellyfin.Database.Implementations.csproj` (+2 -0) </details> ### 📄 Description Since we're now fully on EFcore, let's try this again **Changes** * Add 2nd level cache * Use CacheManager Bond Serializer ([Benchmark](https://github.com/MichaCo/CacheManager/blob/dev/benchmarks/CacheManager.Benchmarks/SerializationBenchmark.cs)) **Comments** * This increased UI responsiveness immensly for me * So far I haven't encountered any issues --- <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 2026-02-07 07:22:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13982