Thursday, February 15, 2007

How to prevent the caching of visited pages

1 comment:

Anonymous said...

To prevent the caching of visited pages:
Use following html header in your html page.

META HTTP-EQUIV="Pragma" CONTENT="no-cache"
and
META HTTP-EQUIV="Expires" CONTENT="-1"

In jsp page u can set same using following:

response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server