From 7b806cf5868b185b8ec4fd07d96de2f871da95a5 Mon Sep 17 00:00:00 2001 From: Dakota Walsh <101994734+dakota-portainer@users.noreply.github.com> Date: Fri, 5 Aug 2022 15:38:45 +1200 Subject: [PATCH] fix(cache): trigger page reload on logout (#7407) When portainer is restarted the user's session is invalidated and as soon as they start clicking around they will be logged out. This PR does two additional things when this happens. 1) We trigger a browser page reload which will force the client the grab the latest version of our js, css, etc. Previously if a user updated portainer, but never clicked the browser's refresh button they would never see new css changes. 2) We also set "cache-control no-cache" on the index.html header. Since portainer is an SPA and the the index.html is very small it makes sense to avoid letting the browser cache it so that the user is always given the latest version when the above reload is triggered. --- app/index.html | 3 +++ app/portainer/__module.js | 1 + 2 files changed, 4 insertions(+) diff --git a/app/index.html b/app/index.html index 25aec60e5..fe9ad7081 100644 --- a/app/index.html +++ b/app/index.html @@ -5,6 +5,9 @@