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)
我怎樣才能使網頁瀏覽器緩存這些文件?