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

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

问题描述

我有一个包含很多小图像(图标)的页面.与 chrome 一起使用时,每次重新加载页面时,chrome 都会使用 if-modified-since 标头从服务器请求每个图标.

所有图标都带有 expires 和 max-age 标头.Firefox 从其缓存中加载图像.

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

谢谢

解决方案

你检查过请求头了吗?

'Cache-Control' 始终设置为 'max-age=0',无论您是按 Enter、f5 还是 ctrl+f5.除非您启动 Chrome 并输入 url 并按 Enter."

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-since 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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