如何在HTML表格中优化多个重复图像 [英] How to optimize multiple repetitive images in HTML table

查看:150
本文介绍了如何在HTML表格中优化多个重复图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在生成一个大的HTML表格,并且我为许多单元格使用了图片。例如,一列可能有竖起大拇指的图像或拇指向下的图像。如果我有300行,其中200行是竖起大拇指,它们都有

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>

所以看起来我要去服务器200次以获得相同的图像,并且也是100次为大拇指朝下形象。

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?

返回大量重复图像的HTML表格时,最佳做法是什么?

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

推荐答案

每个浏览器都会缓存图片,只下载一次。

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

这篇关于如何在HTML表格中优化多个重复图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆