Chrome缓存过长 [英] Chrome Caches for Too Long

查看:139
本文介绍了Chrome缓存过长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站www.johnshammas.com上,它适用于所有浏览器。除了...在Chrome浏览器上查看过以前版本的任何人都会停留在该版本上,直到他们清空缓存为止。什么会导致网站返回一个未修改的头,实际上它已经被大量修改了?

解决方案

code> 304 Not Modified 响应被返回,这是因为之前服务器使用 ETag Last-Modified 头。



稍后,浏览器将此值作为 ETag If-Modified-Since 标头。服务器识别ETag或日期,以便资源在浏览器最后一次请求时没有改变。



所以它返回一个 304



如果您对这些或其他缓存标头不熟悉,我建议对它们进行一些研究。关于这些内容以及如何使用它们,有很多很棒的教程。


On my website, www.johnshammas.com, it works perfectly in all browsers. Except...anyone that has viewed the previous version on Chrome is stuck with that version until they empty their cache. What would cause the website to return a "not modified" header when in reality it has been modified heavily?

解决方案

If a 304 Not Modified response was returned, it was because earlier the server sent a response with an ETag or a Last-Modified header.

Later, the browser sent this value as an ETag or If-Modified-Since header. The server recognized the ETag or date such that the resource had not changed since the browser last requested it.

So it returned a 304.

If you are not familiar with these or other cache headers, I recommend doing some research on them. There are many great tutorials on what these are and how to use them.

这篇关于Chrome缓存过长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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