From 08ccca266facfc610a1c33489bd9ba8cac263585 Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Tue, 30 Jul 2024 21:22:09 +0200 Subject: [PATCH] append version to script URL at script injection time This will force the browser to refresh its cache. --- ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs index 9f75f35..4c4f386 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs @@ -413,7 +413,8 @@ public class Plugin : BasePlugin, IHasWebPages _logger.LogDebug("Reading index.html from {Path}", indexPath); var contents = File.ReadAllText(indexPath); - var scriptTag = ""; + // change URL with every relase to prevent the Browers from caching + var scriptTag = ""; // Only inject the script tag once if (contents.Contains(scriptTag, StringComparison.OrdinalIgnoreCase)) @@ -422,6 +423,10 @@ public class Plugin : BasePlugin, IHasWebPages return; } + // remove old version if necessary + string pattern = @"