3.6 CACHE Control in Servlet and jsp

There are three basic HTTP response headers that prevent a page from being cached to disk. Different browsers handle them in slightly different ways, so they need to be used in combination to ensure all browsers do not cache the specific page. These headers are "Expires", "Pragma" and "Cache-control". In addition, these headers can either be sent directly by the server or placed in the HTML code as HTTP-EQUIV META tags within the HEAD section. The "Expire" header gives a date at which point the page should expire and no longer be cached. Internet Explorer supports a date of "0" for immediately and any negative number for already expired. The "Pragma: no-cache" header indicates that the page should not be cached.

Uses below code to prevent cache control

response.setHeader( "Pragma", "no-cache" );  
response.setHeader( "Cache-Control", "no-cache" ); 
response.setHeader( "Cache-Control", "no-store" ); 
response.setDateHeader( "Expires", -1 );