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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user