Jquery 如何在请求一次后多次使用图像:)
嗨,我想使用相同的图像多次响应一次,我需要再次要求相同的图像吗 这将给带宽带来问题:Jquery 如何在请求一次后多次使用图像:),jquery,Jquery,嗨,我想使用相同的图像多次响应一次,我需要再次要求相同的图像吗 这将给带宽带来问题: .c_description div { display:inline-block; width:25px; height:20px; margin-bottom:-2px; background:url("../images/general/emoji.png") no-repeat; background-position:2px -1px; } 只要您的
.c_description div {
display:inline-block;
width:25px;
height:20px;
margin-bottom:-2px;
background:url("../images/general/emoji.png") no-repeat;
background-position:2px -1px;
}
只要您的服务器不做任何奇怪的事情,并且它返回用于缓存图像的正确头,您就可以根据需要多次请求它
当第一次请求图像时,它将被下载并添加到浏览器缓存中,之后,它将从缓存中加载,而不是再次从服务器下载。ty要回答这个问题,是否有cache iamge to browser=true的代码?大多数Web服务器会自动为您执行此操作,除非您将其关闭。有关标题的概述,请参阅->