From e087daae94f38cf9dc2f4ceb7ff41247643db7e9 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 3 Sep 2023 12:25:57 +0200 Subject: [PATCH] nextcloud: add cache-control headers to static assets --- data/nextcloud/nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/nextcloud/nginx.conf b/data/nextcloud/nginx.conf index d58819c..34267ad 100644 --- a/data/nextcloud/nginx.conf +++ b/data/nextcloud/nginx.conf @@ -11,6 +11,9 @@ location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri /index.php$request_uri; + # 182 days, 14 hours, 54 minutes, 23 seconds. I have no clue why + # this exact value, but i copied it from the example config. + add_header Cache-Control "public, max-age=15778463, $asset_immutable"; location ~ \.wasm$ { default_type application/wasm; @@ -29,3 +32,10 @@ location / { try_files $uri $uri/ /index.php$request_uri; } + + # cursed shit, use like this to have the 'map' feature outside the regular nginx config +} + +map $arg_v $asset_immutable { + "" ""; + default "immutable";