perf(deploy): cache the YouTube artwork at the nginx edge

Thumbnail responses are immutable for a month, so nginx can answer repeats
from disk and never wake the web player or Google for them. The cache lives in
its own volume, collapses concurrent misses with a lock and serves stale
copies while it refreshes; THUMBNAIL_CACHE_SIZE sizes it.
This commit is contained in:
2026-07-20 17:40:28 +02:00
parent 8af7840f5c
commit be662048b1
3 changed files with 28 additions and 0 deletions
+2
View File
@@ -60,6 +60,8 @@ AUTH_ALLOW_INSECURE_HTTP=false
AUTH_REQUIRE_HTTPS=true
# Largest request body nginx accepts (audio uploads go through the web player).
MAX_UPLOAD_SIZE=1024m
# Disk nginx gives to the cached YouTube artwork it serves for the web player.
THUMBNAIL_CACHE_SIZE=2g
# Extra yt-dlp flags for the Worker. The cookie jar avoids YouTube's bot checks;
# drop it here if you do not have one: deploy/secrets/ is mounted at /secrets.
YTDLP_ADDITIONAL_ARGUMENTS=--cookies /secrets/youtube_cookies.txt --extractor-retries 1 --socket-timeout 15 -N 4