File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Setting response page expire time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Setting response page expire time" Watch "Setting response page expire time" New topic

Setting response page expire time

pravin rane

Joined: Nov 07, 2005
Posts: 6
hi all,
i wanted to set the page expiry time such that for each request the client
browser request server to retrieve the page (now it returns the page which is cached by the browser). i wanted to force client browser to request the
server for each and every request page.

will you please let me know how to do this

thanks in advance.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
By setting an appropriate header on the response, you can instruct the browser not to cache the response.

response.setHeader("Cache-Control", "no-cache")
response.setHeader("Pragma", "no-cache")

So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: Setting response page expire time
It's not a secret anymore!