From 01cdfa1bbccd87234a793b10732b9f33388deeed Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 5 Oct 2022 15:17:07 +0530 Subject: [PATCH] document yet another way that Safari/webkit is terrible --- docs/example.nginx.conf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index 1f71fc8b7..761216d5f 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -84,12 +84,17 @@ server { error_page 404 /customize.dist/404.html; # any static assets loaded with "ver=" in their URL will be cached for a year - if ($uri ~ ^(\/|.*\/|.*\.html)$) { - set $cacheControl no-cache; - } if ($args ~ ver=) { set $cacheControl max-age=31536000; } + # This rule overrides the above caching directive and makes things somewhat less efficient. + # We had inverted them as an optimization, but Safari 16 introduced a bug that interpreted + # some important headers incorrectly when loading these files from cache. + # This is why we can't have nice things :( + if ($uri ~ ^(\/|.*\/|.*\.html)$) { + set $cacheControl no-cache; + } + # Will not set any header if it is emptystring add_header Cache-Control $cacheControl;