Google Chrome缓存 [英] Google Chrome Cache

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

问题描述



我有以下标题:

 < META HTTP-EQUIV =CACHE-CONTROLCONTENT =NO-CACHE> 
< META HTTP-EQUIV =CACHE-CONTROLCONTENT =NO-STORE>
< META HTTP-EQUIV =PragmaCONTENT =no-cache>
< META HTTP-EQUIV =ExpiresCONTENT = - 1>

另外,每次我发布新版本的应用程序时,都会更改文件名。因此,它变得像MyApp_v1.swf,然后更新为MyApp_v2.swf。



尽管如此,铬仍然会缓存html页面和swf文件。这是一个主要问题,因为客户不会看到更新的swf,除非他们清除浏览器缓存。



我甚至试图通过更改htaccess文件来解决这个问题,并重命名承载swf文件的index.html文件:

  RewriteEngine On 
RewriteCond%{HTTPS}!= on
RewriteRule ^(。*)$ https://www.mysite.com/app[R,L]
DirectoryIndex index.html#这是从myapp.html

即使在这样做之后,Chrome仍然会缓存swf,并且仍旧从旧的html文件中读取数据。



这在所有其他浏览器中都可以正常工作。


<这两个bug报告相关,这里有一些很好的相关信息:

Issue 28035 - 铬 - 缓存不粘附到无缓存选项(谷歌浏览器)



Issue 64139 - 铬 - 高速缓存未正确重新验证,无缓存指令



另一种解决方案可能是添加特定的缓存控制 code>或 pragma 上面链接中提到的HTTP标题

另外,哑巴问题,你在测试< meta> no-cache标记之前清除chrome缓存?想知道在更改之前它是否仍在使用缓存。


I have an html page that embeds a flash (flex) application.

I have the following headers:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

In addition, each time I release a new version of the app, I change the file name. So, it becomes something like MyApp_v1.swf, which is then updated to MyApp_v2.swf.

Despite this, chrome still caches the html page and the swf file. This is a major problem, as clients do not then see the updated swf unless they clear their browser cache.

I even tried to get around this with changing the htaccess file, and renaming the index.html file that hosts the swf file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://www.mysite.com/app[R,L] 
DirectoryIndex index.html #this was changed from myapp.html

Even after doing this, Chrome still caches the swf, and is STILL reading from the old html file. I do a view source on the html, and its still showing the old file.

This all works fine in any other browser.

解决方案

These two bug reports relate, some good relevant information in here:

Issue 28035 - chromium - Cache doesn't adhear to No cache options ( google crome )

Issue 64139 - chromium - Cache isn't revalidated properly, no-cache directive

Another solution may be to add specific cache-control or pragma HTTP headers as mentioned in the links above

Also, dumb question, did you clear chrome cache before testing your <meta> no-cache tags? wondering if it is still using cache from before your changes.

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

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