This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Page Expires Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Page Expires" Watch "Page Expires" New topic
Author

Page Expires

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Bear ,

I have always been a "FAN" of your posts.. Your posts has always helped me and other ranchers around here at the Ranch.

This time , I've got a query for you and may be for someone who can really help me or guide me out.

I've heard that we can expire the page using the meta tag or using the scriptet. Now, thats fine ! But though it might be a good idea to expire the page once its visited. I want to know why would one use this idea and that too , when we press back button of the browser it says "The page you are trying to access has been expired , click Refresh....." , Once we refresh it , It again gives the same details it had when it was not expired.

This has really been nailing me. Request you to please guide me on this.

Thanks in advance.

Yogendra Joshi.
[ May 30, 2006: Message edited by: Bear Bibeault ]

Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

How have you set the page to expire?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
I've been using this :

<% response.setHeader("Pragma","no-cache");%>
<% response.setHeader("Cache-Control","no-store");%>
<% response.setDateHeader("Expires",-1);%>

and using the meta tag i am using this :

<meta http-equiv="expires" content="0">

Thanks for any help.

Yogendra Joshi.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

The no-cache headers should prevent the browser from caching the page and retrieving the cached version when the same URL is hit. The Back button is a different matter.

I'd suggest searching through previous posts in this and the HTML forum for previous discussion on this issue.

(P.S. disabling the Back button is not an effective strategy).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page Expires
 
Similar Threads
Refresh times to be one
jsp:forward
why page has been expired without take more time after page opened ?
Spring Wizard keyboard back button takes to Expired page in IE6
Expiring a pdf document in the browser