Duplicate network request for images when setting "src" that has already been downloaded

(To be fair, I don’t know if this is related to Kirby or how browsers handle caching in general.)

With JavaScript, I’m dynamically inserting a <img src="[Kirby Image URL]">. When I do this multiple times with the same URL, the browser keeps downloading that image multiple times. I would expect the browser not to download it because it had already been requested/cached.

Is this normal behaviour when requesting resources via JavaScript or is it somehow related to the built-in PHP server or Kirby Cache?

Doesn’t sound like a Kirby related problem. Is browser caching on or off?

That might be it. I first realised it in Safari even though I enabled the cache. I know checked in Chrome with cache enabled and it’s fine. Still not sure what’s going on in Safari but maybe it’s just devtools related :smiley: