From 1a0d7f048e1aa322824e1d5116f54111d896523f Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Wed, 13 Nov 2024 12:06:43 +0000 Subject: [PATCH] Fix cache deletion for script URLs with query parameters --- src/framework/handlers/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/framework/handlers/script.js b/src/framework/handlers/script.js index 6441589f17d..fde854c1cb4 100644 --- a/src/framework/handlers/script.js +++ b/src/framework/handlers/script.js @@ -69,7 +69,8 @@ class ScriptHandler extends ResourceHandler { callback(null, obj, extra); // no cache for scripts - delete self._loader._cache[ResourceLoader.makeKey(url, 'script')]; + const urlWithoutEndHash = url.split('&hash=')[0]; + delete self._loader._cache[ResourceLoader.makeKey(urlWithoutEndHash, 'script')]; } else { callback(err); }