how to clear browser cache programmatically in jsp?

后端 未结 5 2243
情歌与酒
情歌与酒 2020-12-09 13:20

In my web application there is some problem due to browser cache.

How to clear the browser cache when loading my jsp page?

How can i include clear cache code

5条回答
  •  猫巷女王i
    2020-12-09 14:10

    How to disable browser caching for a specific JSP? It is possible to keep the browser from caching a JSP page response. The following hints added to the response header seem to prevent most modern browsers from pulling pages out of cache when the same URL is "hit":

    <%
       response.setHeader( "Pragma", "no-cache" );
       response.setHeader( "Cache-Control", "no-cache" );
       response.setDateHeader( "Expires", 0 );
    %>
    

    The same effect can be achieved by using meta tags in the HTML header:

    
    
    
    

提交回复
热议问题