From 02e45bd0db45ad1c2b475c7971c4ac14708fa8f5 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 26 Jan 2024 13:25:09 -0800 Subject: [PATCH 1/2] [www] fix blank page after deploy All of our asset URLs have a cache buster built into their name. A cached index page will request assets that no longer exist, which is why quasar recommends not caching the index page at all. --- services/frontend/nginx.conf.template | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/frontend/nginx.conf.template b/services/frontend/nginx.conf.template index 0ec0bbca7..6367bdf19 100644 --- a/services/frontend/nginx.conf.template +++ b/services/frontend/nginx.conf.template @@ -49,9 +49,12 @@ http { location / { try_files ${ESC}uri /index.html; - # Short lived cache for non-asset pages - expires 5m; - add_header Cache-Control "public"; + # From https://quasar.dev/quasar-cli-vite/developing-spa/deploying/ + # + # > It’s important that you do not allow browsers to cache the index.html file. + # > Because otherwise updates to this file or to your app might slip through the cracks + # > for browsers that load the index.html from cache. + add_header Cache-Control "no-cache, no-store, must-revalidate"; } location ~* \.(?:css|js|jpg|svg)$ { From c4b777980e4f6ca403f5c8c7b299e2673e653a3a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 26 Jan 2024 15:12:58 -0800 Subject: [PATCH 2/2] reload page if stale assets detected --- services/frontend/www-app/index.html | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/services/frontend/www-app/index.html b/services/frontend/www-app/index.html index 6eab2425b..26a68c5c7 100644 --- a/services/frontend/www-app/index.html +++ b/services/frontend/www-app/index.html @@ -1,6 +1,69 @@ + + <%= productName %>