From 05465853996a5bca7d92ce7ff4d40cdb775160a9 Mon Sep 17 00:00:00 2001 From: "srvproxy001.itguys.com.br" Date: Thu, 18 Sep 2025 22:33:38 -0300 Subject: [PATCH] =?UTF-8?q?[Auto-Sync]=20Atualiza=C3=A7=C3=A3o=20das=20con?= =?UTF-8?q?figura=C3=A7=C3=B5es=20em=20srvproxy001.itguys.com.br=20-=20202?= =?UTF-8?q?5-09-18=2022:33:38?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/snippets/cache_immutable_static.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 nginx/snippets/cache_immutable_static.conf diff --git a/nginx/snippets/cache_immutable_static.conf b/nginx/snippets/cache_immutable_static.conf new file mode 100644 index 0000000..4b11ce7 --- /dev/null +++ b/nginx/snippets/cache_immutable_static.conf @@ -0,0 +1,22 @@ +# /etc/nginx/snippets/cache_immutable_static.conf +# +# Snippet de cache EXTREMAMENTE agressivo para ficheiros estáticos que usam +# a técnica de "cache busting" (como o Nextcloud). + +# Ativa o cache para esta localização, usando a nossa zona de cache estática. +proxy_cache static_cache; +proxy_no_cache 0; +proxy_cache_bypass 0; + +# Otimizações de alta disponibilidade. +proxy_cache_lock on; +proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + +# Define que as respostas válidas ficam no cache do Nginx por 30 dias. +proxy_cache_valid 200 30d; + +# --- A OTIMIZAÇÃO MÁXIMA --- +# Instrui o NAVEGADOR do cliente a guardar uma cópia por 1 ANO e a NUNCA a revalidar. +# A flag 'immutable' diz ao navegador: "Este ficheiro nunca mudará. Não volte a pedi-lo." +expires 1y; +add_header Cache-Control "public, immutable";