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 9e4388332f
commit 33cb3c9680
3 changed files with 28 additions and 0 deletions
+5
View File
@@ -29,6 +29,7 @@ services:
# The filter keeps it from eating nginx's own $host / $remote_addr.
MUSIFY_ROOT_DOMAIN: ${ROOT_DOMAIN}
MUSIFY_MAX_UPLOAD_SIZE: ${MAX_UPLOAD_SIZE:-1024m}
MUSIFY_THUMBNAIL_CACHE_SIZE: ${THUMBNAIL_CACHE_SIZE:-2g}
NGINX_ENVSUBST_FILTER: ^MUSIFY_
ports:
- "80:80"
@@ -37,4 +38,8 @@ services:
- ./nginx/templates:/etc/nginx/templates:ro
- ./nginx/snippets:/etc/nginx/snippets:ro
- ./nginx/certs:/etc/nginx/certs:ro
- nginx_cache:/var/cache/nginx
restart: unless-stopped
volumes:
nginx_cache: