1:在html標(biāo)簽中添加 : ?manifest文件 ? ? 如<html ?manifest="manifest.appache">
2:在服務(wù)器添加:mime-type? text/cache-manifest? 如在appache文件夾下的conf/mime.type 文件中 加一行:text/cache-manifest ? appache(文件的后綴)
3:manifest文件中:
CACHE-MANIFEST
#version n.n
CACHE
/css/a.css ? (#需要緩存的文件)
NETWORK
* ? ?(#每次重新拉取的文件)
FALLBACK
/? offline.html? ? (#離線狀況下代替文件)