From b3e56b33e6fce1bd4e4bd7dbfe161524ff777b0c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 14 Sep 2026 21:58:44 +0930 Subject: [PATCH 1/3] fix(docker): stop caching /sw.js long-term, quiet 200 access logs The FrankenPHP base image's (performance) Caddy snippet applies a one-year immutable Cache-Control to every *.js file. That rule also catches the service worker at /sw.js, so browsers can be stuck on a stale service worker for up to a year and never pick up new releases (issue #7069). Add a CADDY_SERVER_EXTRA_DIRECTIVES override that resets /sw.js to 'Cache-Control: no-cache'. Extra directives are imported after the (performance) snippet, so this header wins; other hashed assets keep their long-lived immutable caching. Also set LOG_OUTPUT_LEVEL=error so Caddy's access log stops emitting a line for every successful request (2xx/3xx/4xx are logged at INFO, 5xx at ERROR), cutting the log noise while still surfacing server errors. Both use the base image's supported env-var extension points, so there is no forked Caddyfile to maintain. Verified against serversideup/php:8.5-frankenphp: /sw.js -> no-cache, other .js stays immutable, and no 'handled request' 200 lines are logged. Closes #7069 --- docker-compose.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index cc32b14d0..2a76d32e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,24 @@ services: # SSL Configuration (handled by reverse proxy) SSL_MODE: "off" + # Caddy/FrankenPHP web server configuration + # + # Only log requests at ERROR level or above. Caddy's access log records + # successful requests (2xx/3xx/4xx) at INFO and server errors (5xx) at + # ERROR, so this suppresses the noisy "handled request ... status 200" + # lines while still surfacing 5xx failures. + LOG_OUTPUT_LEVEL: "error" + + # Override the web server's default caching for the service worker. + # The base image's (performance) snippet applies a one-year immutable + # Cache-Control to all *.js files, which catches /sw.js and prevents + # browsers from picking up new service worker versions (issue #7069). + # Extra directives are imported after that rule, so this header wins. + # See: https://github.com/pixelfed/pixelfed/issues/7069 + CADDY_SERVER_EXTRA_DIRECTIVES: | + @service_worker path /sw.js + header @service_worker Cache-Control "no-cache" + # PHP Configuration PHP_POST_MAX_SIZE: "500M" PHP_UPLOAD_MAX_FILE_SIZE: "500M" From a93b28c0383a614bea6be2951938e6162dc15dd8 Mon Sep 17 00:00:00 2001 From: Shlee Date: Mon, 14 Sep 2026 21:59:31 +0930 Subject: [PATCH 2/3] Update docker-compose.yml --- docker-compose.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2a76d32e5..47ad90511 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,21 +52,7 @@ services: environment: # SSL Configuration (handled by reverse proxy) SSL_MODE: "off" - - # Caddy/FrankenPHP web server configuration - # - # Only log requests at ERROR level or above. Caddy's access log records - # successful requests (2xx/3xx/4xx) at INFO and server errors (5xx) at - # ERROR, so this suppresses the noisy "handled request ... status 200" - # lines while still surfacing 5xx failures. LOG_OUTPUT_LEVEL: "error" - - # Override the web server's default caching for the service worker. - # The base image's (performance) snippet applies a one-year immutable - # Cache-Control to all *.js files, which catches /sw.js and prevents - # browsers from picking up new service worker versions (issue #7069). - # Extra directives are imported after that rule, so this header wins. - # See: https://github.com/pixelfed/pixelfed/issues/7069 CADDY_SERVER_EXTRA_DIRECTIVES: | @service_worker path /sw.js header @service_worker Cache-Control "no-cache" From 32c97df680b853ae3adb97bc54ef73244b4ade1e Mon Sep 17 00:00:00 2001 From: Shlee Date: Mon, 14 Sep 2026 22:00:25 +0930 Subject: [PATCH 3/3] Update docker-compose.yml --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 47ad90511..501076f99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,7 @@ services: # SSL Configuration (handled by reverse proxy) SSL_MODE: "off" LOG_OUTPUT_LEVEL: "error" + # TODO: Once the new webui is completed, we will try to handle the service worker cache on that side. CADDY_SERVER_EXTRA_DIRECTIVES: | @service_worker path /sw.js header @service_worker Cache-Control "no-cache"