Look at the following code. Chrome logs one request in debug console. If this is because of caching, why does it not log two requests with the last one being 304?
What explains this browser behavior?
<script>
new Image().src="//stackoverflow.com/"
new Image().src="//stackoverflow.com/"
</script>
The browser has already downloaded the image, why would it make another request for the same image? If an image is used more than once on a page (which happens regularly), making an individual request for each instance it's used would produce a ton of unnecessary overhead. Two images with the same URL within the same page are assumed to be the same image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With