Forum Moderators: open

Message Too Old, No Replies

Refresh when using back button

         

torstendlp

9:46 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



Hello,

I looking for a way to force the clients browser to refresh a site when the user is hitting the back button.
Example:
User visits page A and goes from there to page B.
Then he is hiting the "back"-Button. Now the browser should not use the page A from cache but load a new page A from the server.
I tried:
<META http-equiv="Cache-Control" content="no-cache">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="-1">

This works on Netscape but not on IE.

The method I need should work on standard html-pages.
The methos should not use perl or asp.
php is possible.
It should work with sessions.
If possible it should be possible to put the necessary code into the <head> or the <body> of the document.

I would apreciate very much if somebodya could help me!

...and sorry for my poor english...it has become very rusty since I don't use it so much anymore!

Thank you very much!

Torsten

tedster

1:00 am on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As far as I know, the only way to get IE to listen to cache control directives is for them to be in the HTTP header that is sent from the server. IE completely ignores the Pragma Cache-Control meta tag.

txbakers

1:42 am on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is it possible to do a javascript reload() in the Body element?

<body onLoad="window.reload()">

I've never tried this though.

tedster

6:52 am on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



tx, doesn't that create an infinite loop?

txbakers

1:59 pm on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, I guess it might.

I've run into this situation before and I can't remember what I did. I do remember that I didn't care for the solution though.

It's messing with the normal functions of the browser again.

torstendlp

2:52 pm on Mar 9, 2004 (gmt 0)

10+ Year Member



Hello,

maybe I specify my problem a bit:
I am running an online shop.
A summary of theshopping cart is shown permanently on each site of my shop.
If somebody adds something to the shopping cart the shopping cart automacally refreshes and shows a new summary of the shopping cart.
If now somebody pushes the back-button in his browser he returns to the last site visited (loaded from his cache) and sees the old version of the shopping-cart summary.
I expect that this can be very disturbing for some visitors.
One specific example:
Somebody visits my site.
He goes to a category of my portfolio.
From this overview he goes to the details of one product. There he adds this product to his shopping cart. The shopping-card summary reloads. so far everything is ok. But now if the user uses the back button to go back to the overview of porducts this overview is reloaded from his cache and with this also the old shopping cart sumary is displayed.....this can be VERY confusing for the customers!

I hope you understand what I mean and one of you can help me with this problem!

Thanks in advance,

Torsten