iPhone and HTML5 Cache Manifest

前端 未结 4 466
暖寄归人
暖寄归人 2021-02-06 19:08

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

相关标签:
4条回答
  • 2021-02-06 19:34

    You should use the Safari Javascript Database API which should work for iPhone and Safari 3.1. It works great for local caching and data storage:

    http://developer.apple.com/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/

    0 讨论(0)
  • 2021-02-06 19:41

    The cache manifest file has to be served with a 'text/cache-manifest' mime-type. This is absolutely critical, it will not work without it. If you navigate to the url of your manifest file, it should trigger a download...

    Also, I've found that putting the manifest location in the tag as an absolute location, as well as all the entries in the manifest file to be more effective.

    0 讨论(0)
  • 2021-02-06 19:47

    It could be to do with the size of the output.

    I can't talk from any serious experience in tweaking things specifically for an iphone, but there is an intersting read from the YUI team here: http://yuiblog.com/blog/2008/02/06/iphone-cacheability/, which indicates that the largest unzipped cache file that can be held in an iphone is 25k, and that for optimal caching, as many components as possible should be <25k.

    That may be the cause of your problems, but that's only a guess.

    0 讨论(0)
  • 2021-02-06 19:51

    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.

    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.

    0 讨论(0)
提交回复
热议问题