feat: Add Video Cache compression

Video information from youtube always weight about ~60KB uncompressed.
When using Deflate to compress that information, it gets compressed down
to ~15KB, so now you will be able to store up to 4x entries more with
caching enabled.

For context, nadeko.net Invidious instance stores 54.7k keys, since we
also store the `time` in a different key associated to the video ID, the
real count of videos cached would be 27.3k. With compression enabled,
the Redis database will be able to store up to 4 times more videos in
cache, which is 109.2k videos cached.

Pretty cool huh.
This commit is contained in:
Fijxu
2025-10-16 17:09:38 -03:00
parent 24218dc5df
commit aa8b5cfd4b
3 changed files with 79 additions and 3 deletions

View File

@@ -1158,6 +1158,13 @@ video_cache:
##
lru_max_size: 18432
## Compress cache with Deflate to save RAM. Only works with Redis (1) and
## LRU (2) cache.
##
## Accepted values: false, true
## Default: false
##
compress: false
##
## Maximum resolution that is going to be displayed