开发者

Use image from cache or download

I have noticed Chrome sometimes download images which have Expires in the future. What rules do browsers follow when they to use cached image (when Expires is after current date) or to 开发者_Python百科download image despite of cache?


If the server returns 304 Not Modified , then images cached by browser are rendered . If you have explicitly cached images by setting headers or using manifest , then they wont be re-downloaded till it expires .


You should read this: http://msdn.microsoft.com/en-us/library/bb250442.aspx and http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx for some background on how caching works in web browsers. You can use Fiddler's CACHING response inspector to check for other headers that may impair caching or force revalidation.

Also, keep in mind that Refresh operations (e.g. F5) will re-download already cached resources, and that the client cache isn't of infinite size and hence content which is scavenged from the cache will need to be redownloaded on next use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜