When I hit the "back" button in FirFox browser it takes me back to the top of the page, for example if I have entered a link, then I want to go back to where I was reading, FireFox takes me back to the top of the page instead of to where I entered the link from.

I don’t have this problem with IE.

I’m using bluemarine. Anyone know how I can eliminate this problem?

Comments

jason342’s picture

No one knows how to fix this?

VM’s picture

i dont see what you are talking about and dont think its a drupal or a theme issue but a nuance of the browser you may be noticing. although I just paged half way down, drupal.org clicked a link, waiting for new page to load, hit back button and was returned back to the middle of the page i left. using FF 2.0

perf’s picture

This problem is due to the cache-control header from drupal. If that header contains "no-store", firefox refuses to cache the page, Using https, it's enough to include no-cache to get this behaviour. (See http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching for the full story.) So if IE immediately displays the page when you hit the back button, it's not honouring the cache-control header.

One might argue that they would be able to remember the position even if the page isn't in the cache, but that obviously doesn't happen even if it would make life much easier.

To "fix" this in drupal you must modify the headers sent like this (in includes/bootstrap.inc):

  //header("Cache-Control: no-store, no-cache, must-revalidate");
  //header("Cache-Control: post-check=0, pre-check=0", FALSE);
  //header("Pragma: no-cache");
  header('Cache-Control: private'); // added

However, allowing caching of dynamic content can be confusing, and might for example show a cached page saying that you are logged in even if you logged out.

moshe weitzman’s picture

indeed you right. drupal has been patched so the back button actually works as designed. so far, it won't appear until drupal6. see http://drupal.org/node/109941

chocolateboy’s picture

jonelectrasoftcom’s picture

Hello Jason:

At the end of your page...
Change this:

</BODY>
</HTML>

To this:

<BR>
</BODY>
</HTML>

In other words, add the <BR> just before the </BODY>

Please advise?

Regards,
Jon

chocolateboy’s picture

This has been fixed in Firefox trunk.