Thursday, June 29, 2006

How can i prevent Browser from Caching the Page content?

Before sending the data to the browser, use the following code:

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

This also helps in case, when user should not be able to see previous pages by clicking the Back button in the browser.

No comments:

Total Pageviews

Reading List - 05-Mar-23

Talking to #AI may be the most important job skill of this century ( JohnGoodPasture ) Role of account management over the years. It’s a ro...