HTML5 applicationCache vs Browser Cache

2019-04-09 17:52发布

With current applicationCache implemented in browsers, my appcache manifest file changes the version number which then triggers the applicationCache update event which forces browser to download fresh resources mentioned in the manifest files from the server.

Let's say I have configured far future expiry headers on those resources. Will those files still be downloaded? Or will be read from browser cache itself?

We implement a versioning based logic to invalidate browser caches (chaging the file name itself). I am wondering, with appcache in place, do we need a hybrid of versioning + applicationCache?

1条回答
forever°为你锁心
2楼-- · 2019-04-09 18:45

When you update the manifest file (actual change or a version comment) your browser will download every single file listed in the CACHE and FALLBACK sections. It's up to the browser to implement this how they see fit, but the better implementations out there will do it in smart ways. Current implementations do not all work in interoperable ways though. For example, browsers can check for HTTP code 304 "Not Modified" instead of blindly downloading the files.

Check out: http://appcachefacts.info/ --this one says that " If any [files listed in the CACHE section] are already in the browser's cache, they will not be downloaded again separately.

Seth Ladd (Google) wrote an interesting article about this: http://blog.sethladd.com/2010/10/proposal-to-enhance-html5-app-cache.html

Moe info: http://www.slideshare.net/peterlubbers/using-html5-application-cache-to-create-offline-web-applications

查看更多
登录 后发表回答