Cache manifest offline app not refreshing javascript files in Chrome

感情迁移 提交于 2019-12-05 02:15:58
amernov

That's because the webserver tells the browser cache static files for a few hours. So the browser doesn't know the manifest file is changed. You can clear all the application data 'or' config the web server the manifest is not cacheable...

Read http://diveintohtml5.info/offline.html for more info

If you want to clear your app cache on chrome use chrome://appcache-internals/ and by hand you have to search in C:\Documents and Settings\YOURUSERNAME\Local Settings\Application Data\Google\Chrome\User Data\Default\Cache

I had assumed that you if you use a cache manifest and then refresh the manifest, that the browser would request all of the files again. However, I have found that I needed to explicitly set headers in all of the files in the manifest to tell the browser not to cache the files. I believe that once the manifest tells the browser to request the file again, the browser treats it like any other non-manifest cached file. Maybe this is an error with Chrome, but I feel like I saw this in another WebKit browser.

Regardless, set the headers for the files in the manifest to never be cached and they should reload when you update the manifest. If these files are used outside of a manifest page, you may need to actually cache the files depending on your needs.

Type chrome://appcache-internals in your address bar then click ENTER

A list of cached manifests will appear then just delete the one you want and everything will be refreshed when you load your page again.

Hope this helps :)

I had the same problem until I came across this priceless warning on the Mozilla Developer site

Important: Do not specify the manifest itself in the cache manifest file, otherwise it will be nearly impossible to inform the browser a new manifest is available.

woops. my bad.

However, every time I change something in the code, I need to change something in the manifest, and then reload twice, which is an unrelated issue.

Garry

In my case, i has to disable the traditional browser cache using meta tags. See this SO question how to that

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!