From eb0fbde6054bd6aec5b297a7afab0ae08cb3a115 Mon Sep 17 00:00:00 2001 From: Andrei Rudenko Date: Thu, 14 Mar 2024 03:51:45 +0200 Subject: [PATCH] Bypass browser cache on reloading image with the same name. Not sure if its good, the intention was to have reloading changed images with the same name working on electron. Could this be bad for browser games in terms of loading time? --- Backends/HTML5/kha/LoaderImpl.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backends/HTML5/kha/LoaderImpl.hx b/Backends/HTML5/kha/LoaderImpl.hx index acf27d2b6..77f9bdc82 100644 --- a/Backends/HTML5/kha/LoaderImpl.hx +++ b/Backends/HTML5/kha/LoaderImpl.hx @@ -36,7 +36,7 @@ class LoaderImpl { img.onerror = function(event: Dynamic) failed({url: desc.files[0], error: event}); img.onload = function(event: Dynamic) done(Image.fromImage(img, readable)); img.crossOrigin = ""; - img.src = desc.files[0]; + img.src = desc.files[0] + '#' + Date.now().toString(); } }