页面离线应用缓存

实例:

<!DOCTYPE html>
<html lang="en" manifest="index.appcache">
<head>
    <meta charset="UTF-8">
    <title>页面离线缓存</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <script type="text/javascript" src="index.js"></script>
</head>
<body>
    <div></div>
</body>
</html>

然后在index.html同目录新建文件index.appcache,index.appcache内容:

CACHE MANIFEST
CACHE:
index.html
style.css
index.js
NETWORK:
style.css(不缓存style文件)

 

Manifese 文件:

1)CACHE MANIFEST - 在此标题下列出的文件将在首次下载后进行缓存

2)NETWORK - 在此标题下列出的文件不会被缓存

3)FALLBACK - 在此标题下列出的文件规定当前页面无法访问时的回退页面(例如404页面)

posted @ 2016-07-19 15:47  FelixWeb  阅读(209)  评论(0编辑  收藏  举报