iPhone和HTML5缓存清单 [英] iPhone and HTML5 Cache Manifest

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

问题描述

我正在尝试使用ASP.NET构建iPhone Web应用程序.该页面为每个访问者动态呈现一次.此时,可以将页面添加为书签,并且该访问者永远不会再更改.因此,从那时起,应将其缓存在本地,这样即使没有网络连接,也可以从书签中引用该应用程序.无论我尝试什么,手机都会继续从服务器请求页面以强制重新渲染,否则如果手机处于脱机状态,它将失败.

I am trying to build an iPhone web application using ASP.NET. The page is dynamically rendered once for each visitor. At this point the page can be bookmarked and it will never change again for that visitor. For this reason it should be cached locally from that point on so the application will run if referenced from the bookmark even if no network connection is available. No matter what I try the phone continues to request the page from the server forcing a re-render or it fails if the phone is offline.

Louis Gerbarg

Louis Gerbarg suggested in this post that I use HTML5 Cache Manifest to get this working however following the w3.org docs does not appear to work for the iPhone. Does anyone have a good example where application cache is working?

推荐答案

我回答了您先前与此相关的问题,但是从该问题中我们还不清楚您是否试图缓存动态内容.缓存清单用于获取所需的静态内容,以使脱机Web应用程序正常工作.

I answered your previous question related to this, but it was not clear from that question that you were trying to cache dynamic content. The cache manifest is for getting static content you want for offline web apps to work.

我不确定您可以做什么.您是否希望该应用程序能够脱机运行,还是只是因为下载速度慢而试图在缓存中钉住某些内容?除非您实际上是在构建离线的Web应用程序(用户将其添加为书签或Spring Board中的应用程序),否则您的页面可以(并且必须)从浏览器中从本地存储中撤出,无论您在页面上设置的缓存策略.

I am not sure you can do what you want. Do you want the app to be able to function offline, or are you just trying to peg something in the cache because it is slow to download? Unless you are actually constructing an offline webapp (which the user will add to as a bookmark or an app in the Spring Board) then your page can (and must necessarily) be evicted from local storage at the browsers discretion, regardless of how loose a cache policy you set on the page.

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

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