• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1034
  • Last Modified:

Convince FireFox to refresh page from server on Back

Hi Experts.

I am interested in convincing FireFox/IE to refresh a page from the server when the back button is pressed. Basically what I want is that each time a visitor views that page, either by following a link to it or by pressing Back/Forward on his browser if he was previously there, that page should be requested from the server.

Or at least, if that's not possible, make FF execute JavaScript on Back/Forward (see below).

So far, I'm using cache-control, pragma and expires, and it works in IE 6 like a charm.

But no luck with FF.

With FF, even some JavaScript on that page (a simple alert) doesn't execute when I press the back button. So it appears that FF uses a memory cached copy no matter what, and doesn't even execute onload JavaScript when navigating back to that page.

Any ideas how can I force FF to refresh the page from the server when the user presses the back button, or at least make it run the JavaScript code that's on that page?

Thank you.

Sincerely,
Catalin Ionescu
0
heatseeker
Asked:
heatseeker
  • 3
  • 2
1 Solution
 
thirdCommented:
just add,

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

between the head tags.
0
 
heatseekerAuthor Commented:
third,

I am already using that, as well as cache-control and expires meta tags, but neither does the job in FireFox.

What puzzles me even further is that not even JavaScript executes for the back navigation in FireFox.

Sincerely,
Catalin Ionescu
0
 
Dennis MaederCommented:
The following works for me, but it is important to kill FF before running or the cache is retained.
D
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-store">
<script type = "text/javascript">
alert ("hello world")
</script>
</head>
<body>
test
</body>
</html>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Dennis MaederCommented:
heatseeker,
The no-store is what does it - the rest are there for multiple-redundancy and other browsers.
D
0
 
heatseekerAuthor Commented:
dennis,

Yep, it does indeed work! Thanks a bunch mate. You've saved my sanity, and a few of the remaining hair :)

Sincerely,
Catalin Ionescu
0
 
Dennis MaederCommented:
My pleasure!
D
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now