Unable to disable jsp cache

后端 未结 1 425
傲寒
傲寒 2020-12-20 07:41

I don\'t want the browser to cache a specified jsp, so I used the code below in my jsp:

<%
    response.setHeader(\"Pragma\", \"No-cache\");
    response.         


        
相关标签:
1条回答
  • 2020-12-20 08:19

    A typo? Pramga instead of Pragma? Try.

    <%        
        response.setHeader("Pragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
        response.setDateHeader("Expires", -1);
    %>
    

    EDIT: see this question How to control web page caching, across all browsers?

    0 讨论(0)
提交回复
热议问题