1
我用Privoxy或Proxomitron注入定制的Javascript代码到网站中,然后从本地蟒蛇服务器加载脚本(在本地主机:8888):缓存本地文件
... <script type="text/javascript"
src="http://localhost:8888/tweakscript.js"
></script></body>
一些脚本标签是巨大的第三方JavaScript库也存储在我的电脑上。他们从不改变,但每次都重新加载。我想缓存它们。
我想这些头,没有成功:
HTTP/1.1 200 OK
Content-type: text/javascript; charset=UTF-8
Vary: Accept-Encoding
Date: Sun, 04 Oct 2015 03:24:14 GMT # the current date
Last-Modified: Fri, 02 Oct 2015 06:34:40 GMT # never changes
Expires: Fri, 01 Apr 2016 03:24:14 GMT # one month in future
Cache-Control: public, max-age=15552000 # cache for one year
Access-Control-Allow-Origin: * # Content Security Policy
Access-Control-Allow-Methods: GET, POST, OPTIONS
Connection: close
(javascript code here)
我怎样才能使网页浏览器缓存这些文件?