WebKit and offlineCache

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章