5

If i have thousands of image <img> tag with same src value, 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 a single request to get the image?

Rajasekar SP
  • 51
  • 1
  • 2
  • One request per image – Anjith K P Jun 16 '15 at 11:52
  • Possible duplicate of [When multiple instances of same images are embedded in an HTML, does that load the image once?](http://stackoverflow.com/questions/11271484/when-multiple-instances-of-same-images-are-embedded-in-an-html-does-that-load-t) – Leonid Vasilev Mar 15 '17 at 13:45

1 Answers1

0

When looking into caching issues, a tool like Firebug for Firefox or the Developer Tools within Chrome are very beneficial. If you open the 'Net' panel in either and reload a page, you will see what HTTP status code was sent for each item. 304 (Not modified) means that the item was retrieved locally from the cache. Additionally when it asks the server for an image, it usually sends with the request for the image, a couple of headers that tell the server.

Bruce
  • 1,647
  • 4
  • 20
  • 22