我正在学习缓存以及如何管理它。
当我打开我的网站页面时,我可以看到图像、css 文件、js 文件等静态内容存储在临时文件夹中。但是现在当我在响应头中添加这些属性时,我看不到缓存行为的任何变化。
所有内容都像以前一样存储。即使我对 js 文件进行了一些更改,我也看不到新的 js 文件正在被获取。浏览器使用相同的旧 js 文件,但内容过时。
所以我做错了什么。
我在 JSP 文件中添加的逻辑:
    response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP1.1.
    response.setDateHeader("Expires", 0); // Proxies.
  response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
在这些更改之后:
响应标头
     Cache-Control:no-cache, no-store, must-revalidate
    Content-Language:en-US
    Content-Length:3333
    Content-Type:text/html;charset=ISO-8859-1
    Date:Fri, 12 Dec 2014 11:48:37 GMT
    Expires:Thu, 01 Jan 1970 00:00:00 GMT
    Pragma:no-cache
    Server:WebSphere Application Server/8.0
    X-Powered-By:Servlet/3.0
在这些更改之前:
响应标头
    Content-Language:en-US
    Content-Length:6788
    Content-Type:text/html;charset=ISO-8859-1
    Date:Fri, 12 Dec 2014 11:50:10 GMT
    Server:WebSphere Application Server/8.0
    X-Powered-By:Servlet/3.0
我只是想知道如何验证这些标头是否正常工作。任何帮助,将不胜感激。