Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome Cache

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.

like image 487
JonoB Avatar asked May 07 '11 00:05

JonoB


People also ask

Is clearing Chrome cache good?

In general, clearing your cache in Google Chrome should lead to a faster, more efficient browsing experience —particularly if you notice that pages are loading slower than usual or websites aren't displaying the most up-to-date information. It can also fix formatting issues on websites.

Can I delete Chrome cache?

In the Chrome appAt the bottom, tap More . Tap History Clear browsing data. Make sure there's a check mark next to “Cookies, Site Data,” and “Cached Images and Files.” Tap Clear browsing data.

What happens if you clear cache on Google Chrome?

When you clear your cache and cookies, all of this information gets deleted. That means that any passwords you've entered on a website will need to be re-entered and the load time of previously visited sites will increase because it needs to load the content of the webpage again.


2 Answers

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.

like image 156
MikeM Avatar answered Oct 27 '22 01:10

MikeM


For all you guys struggeling with this
i found something simple that works...

i tried
1. ctrl + f5
2. ctrl + shift + 5
3. setting the "no cache" in developer tools..

What worked for me in the end is to
Just hold the CTRL key while you click the reload icon!

like image 40
Sagive Avatar answered Oct 26 '22 23:10

Sagive