Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page Expiry

 
Ramneek Handa
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For making a page expire when client presses back button we need to put following code in servlet
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control","post-check=0, pre-check=0");
response.setDateHeader("max-age", 0);
But above is not working with my pages, when I checked it with
response.containsHeader("Cache-Control");
This is returning false. That means there is no Cache-Control in my response header.
That may be the reason my pages are not getting expired.
Can somebody help me out.
Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic