Chrome - 为什么它发送if-modified - 自请求以来? [英] Chrome - why is it sending if-modified-since requests?

查看:204
本文介绍了Chrome - 为什么它发送if-modified - 自请求以来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有很多小图片(图标)的页面。与chrome一起使用时,每次页面重新加载时,chrome都会通过if-modified-since标头向服务器请求每个图标。



所有图标都以expires和max - 标头。 Firefox加载缓存中的图片。



为什么chrome会这样做,我该如何防止它?

谢谢

解决方案


$ b

'Cache -Control'始终设置为'max-age = 0',不管是否按Enter,f5或ctrl + f5。除非您启动Chrome并输入url并按回车键。



http://techblog.tilllate.com / 2008/11/14 / clientside-cache-control /

I have a page with lots of small images (icons). When used with chrome, each time the page is reloaded, chrome requests each icon from the server with if-modified-since header.

All icons are served with expires and max-age headers. Firefox loads images from its cache.

Why is chrome doing that and how can I prevent it?

Thanks

解决方案

Have you checked the request headers?

"‘Cache-Control’ is always set to ‘max-age=0′, no matter if you press enter, f5 or ctrl+f5. Except if you start Chrome and enter the url and press enter."

http://techblog.tilllate.com/2008/11/14/clientside-cache-control/

这篇关于Chrome - 为什么它发送if-modified - 自请求以来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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