WebKit and offlineCache

来源:互联网 发布:淘宝商城儿童女装坎肩 编辑:程序博客网 时间:2024/05/18 10:46

Refer to http://www.w3.org/TR/html5/offline.html to see the spec for HTML5 offline application cache.

1. Write a normal html file with js files and css files

2. Change <html> to <html manifest="test.manifest">

3. write a file named "test.manifest" as following:

 

CACHE MANIFEST

 

# v0.1

test.html

 

# Standard Script Libraries 

clock.js

 

# App Scripts

 

# Content (CSS & images) 

clock.css 

#Content/logo.png

 

NETWORK: 

http://pic.66wz.com/0/00/16/39/163980_140476.jpg

4. Enable offlineApplicationCache in WebKit

5. In logic, setting offlineApplicationCache on in preferences.

6. Add "text/cache.manifest" to web server configuration

 

In implementation, these cache files will be stored in %APP%/Local/Apple Computer/WebKit/ApplicationCache.db

 

原创粉丝点击