HTML5 applicationCache与浏览器缓存 [英] HTML5 applicationCache vs Browser Cache

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

问题描述

在浏览器中实现了当前的applicationCache后, 我的appcache清单文件更改了版本号,然后触发了applicationCache更新事件,该事件迫使浏览器从服务器下载清单文件中提到的新资源.

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?

我们实现了基于版本控制的逻辑,以使浏览器缓存无效(更改文件名本身).我想知道,有了适当的appcache之后,我们需要版本控制+ applicationCache的混合体吗?

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?

推荐答案

更新清单文件(实际更改或版本注释)时,浏览器将下载CACHE和FALLBACK部分中列出的每个文件.由浏览器决定如何实现他们认为合适的方式,但是更好的实现方式将以明智的方式实现.但是,当前的实现并不能全部以可互操作的方式工作.例如,浏览器可以检查HTTP代码304未修改",而不必盲目下载文件.

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.

签出: http://appcachefacts.info/ -这句话说:如果[[CACHE]部分中列出的文件]已经在浏览器的缓存中,则将不再单独下载它们.

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)撰写了一篇有趣的文章: http://blog.sethladd.com/2010 /10/proposal-to-enhance-html5-app-cache.html

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

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

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

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