Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Expiring a page

 
Abraham Jacob
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to expiry a page in the browser history/cache. Basically here is the problem
(post)
jspPage1 ---> jspPage2

When the user is on jspPage2 and presses the browsers back button I want the jspPage1 reloaded/refreshed from the server.
I tried using the META tag
<META http-equiv="Pragma" content="no-cache">
but somehow this does not seem to solve the problem... (I am using IE 5.5)
Thanx,
 
Abraham Jacob
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like I found the answer... (just in case anybody else needs it...)
Using JSP...
<%
response.setDateHeader ("Expires", 0);
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("max-age", 0);
response.setDateHeader("Expires", 0);
%>

Now I have another question.....
Is there any way to find out that the page has expired and that it should reload itself.
Right now in IE 5.5 it shows me that the page has expired and that I should physcically press the refresh/reload button...
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add this tag in the <head> and </head> tag of your HTML, it will refresh the page after every 10 seconds. But, page refreshing itself this frequently is not a good idea, unless you are refreshing some live match score or somthing...

- Manish
 
Abraham Jacob
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for the reply manish
Is there a way to find out that when the user press the back button or the refresh button it is actually loading an expired page which can be trapped by JavaScript ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic