2

我在我的网站的一部分中使用Quake Sliderdiv(s) 。这个插件是从图像创建来进行转换的。问题是当div(s)被创建时,background-image它们的属性根据当前图像src属性发生变化,并导致浏览器从服务器重新加载图像(和奇怪的是不是来自缓存)。谁能告诉我如何更改此插件以在css('background-image')调用 jquery 时不重新加载图像?感谢您的关注。

4

1 回答 1

1

Expiration and caching response headers

Browsers reload content based on their last accessed expiration and caching headers sent from the web server. So if images expired in the past, browser will have to reload them regardless of whether they've just been loaded.

As you're using IIS I suggest you read this question that links to MS resource with description of configuration elements to control this behaviour.

When you configure your server to not expire static content you can still convince browser to reload some static content by adding a random value along with your request i.e.

http://somewhere.com/images/always-realod.jpg?a9s87h7sdf6
于 2013-01-25T10:16:00.640 回答