Multiple <img> tags with the same original src

If I have thousands of images <img>

with the same value src

, something like this

<img src="https://something.com/images/myimg.png" alt="" />
<img src="https://something.com/images/myimg.png" alt="" />
<img src="https://something.com/images/myimg.png" alt="" />
<img src="https://something.com/images/myimg.png" alt="" />
<img src="https://something.com/images/myimg.png" alt="" />
<img src="https://something.com/images/myimg.png" alt="" />
...

      

Then, will the browser send 1000 requests or one request to get the image?

+3


source to share


1 answer


A tool like Firebug for Firefox or Developer Tools for Chrome is very helpful for exploring caching issues . If you open the Network panel and reload the page, you will see what HTTP status code was sent for each item. 304 (Unchanged) means the item was fetched locally from the cache. Also, when it asks the server for an image, it usually sends an image request, a pair of headers that tell the server.



0


source







All Articles