From fb5962c7f6ece1eee542707368c4f5f153fd887e Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Wed, 13 Nov 2024 12:20:46 +0000 Subject: [PATCH] Fix cache deletion for script URLs with query parameters (#7107) --- 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); }