1、在tomcat 的 conf/web.xml 文件中添加节点:
<!-- HTML5离线缓存--> <mime-mapping> <extension>manifest</extension> <mime-type>text/cache-manifest</mime-type> </mime-mapping> <!-- end -->
2、编写manifest文件【名字随意,后缀为manifest】:
例如:
CACHE MANIFEST #DamonTung app v1.0 #指明缓存入口 CACHE: #以下资源必须在线访问 NETWORK: #如果index.php无法访问则用404.html 代替 FALLBACK: /index.php /404.html