This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Page Expiry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Page Expiry" Watch "Page Expiry" New topic

Page Expiry

Ramneek Handa
Ranch Hand

Joined: Nov 10, 2000
Posts: 44
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
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.
I agree. Here's the link:
subject: Page Expiry
Similar Threads
Web proxy caching jsp pages
How to control Caching in JBoss
Logout problem
Cache Control
IE 5.5 Page Reload Issues