如图,在html中出现如上警告。
在html5之后,似乎这样的缓存控制方式不再适用。原因是,虽然各浏览器都可以对这样的方式进行处理,但是如果是代理则完全不起作用。
所以如果要缓存控制的话,建议使用如下方式:
<!DOCTYPE html>
<html manifest="cache.manifest">
。。。。
Then create cache.manifest file with content of what you want to cache i.e
CACHE MANIFEST
# 2010-06-18:v2
# Explicitly cached 'master entries'.
CACHE:
/favicon.ico
index.html
stylesheet.css
images/logo.png
scripts/main.js
# Resources that require the user to be online.
NETWORK:
*
# static.html will be served if main.py is inaccessible
# offline.jpg will be served in place of all images in images/large/
# offline.html will be served in place of all other .html files
FALLBACK:
/main.py /static.html
images/large/ images/offline.jpg