Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to optimize multiple repetitive images in HTML table

Tags:

html

image

I am generating a large HTML table, and I use images for many of the cells. For example, one column might either have a thumbs up image or a thumbs down image. If I have 300 rows and 200 of them are thumbs up, they all have

 <a href="link"><img src="http://myserver.com/thumbsup.png"></a>

so it seems like I am going to the server 200 times to get the same image and also 100 times for the thumbs down image.

Is there any way to make this more efficient? Do browsers recognize this and grab a cached value of the image?

What is the best practice when returning a large HTML table with lots of repeating images?

like image 554
leora Avatar asked Nov 22 '25 04:11

leora


1 Answers

Every browser will cache the image and only download it once.

like image 120
Jordan Running Avatar answered Nov 23 '25 21:11

Jordan Running