View Full Version : cacheSeconds = 0 doesn't work in Mozilla Suite/Firefox
Sep 21st, 2004, 05:08 AM
When I set my Controller to
cacheSeconds = 0
and press the back button in IE, IE reloads the page nicely.
However, in Firefox or Mozilla Suite, pressing the back button doesn't issue a reload. I've tried to set the Cache-control to no-cache, must-revalidate by setting it in my the controller or to 1 second, but to no avail.
Nothing found in the bug database of Mozilla.
Anybody any clues ?
Here's the dump of the HTTP response of the server:
HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html; charset=ISO-8859-1
Date: Tue, 21 Sep 2004 09:04:25 GMT
Nov 5th, 2004, 07:21 AM
Mozilla/Firefox does not reload page marked "no-cache", if a user goes back in the browser session history.
Mozilla/Firefox reloads a page marked "no-store", if a user goes back in the history. This behavior is "as designed" for Mozilla, but have been broken for a while and was recently fixed in Firefox 1.0 RC (see Mozilla bug 252023).
Pages which are marked as "no-cache", but which are served over SSL, are always reloaded by Mozilla.
MSIE reloads a page in all aforementioned cases.
If you want to keep your pages in sync with Model while using Mozilla, you need to mark your responses as "no-store". Struts has the convenient setting <controller nocache="true"/> in struts-config.xml file, but it does not set "no-store" header, it sets only the following headers:
Nov 5th, 2004, 07:57 AM
Thanks, just read the article too 8)
Nov 5th, 2004, 08:33 AM
Now, what I have to find a possible method to override to add no-store to response header for GET and POST with the least amount of trouble
Nov 5th, 2004, 09:27 AM
Maybe this should be reported as a bug in Jira?
Also note the following (quoted from section 13.13 - ah what a number :) - of ftp://ftp.isi.edu/in-notes/rfc2616.txt):
User agents often have history mechanisms, such as "Back" buttons and
history lists, which can be used to redisplay an entity retrieved
earlier in a session.
History mechanisms and caches are different. In particular history
mechanisms SHOULD NOT try to show a semantically transparent view of
the current state of a resource. Rather, a history mechanism is meant
to show exactly what the user saw at the time when the resource was
So in general you can't really solve the problem since using the back button accesses the browser history which means it is not required to refresh the page. As far as I know Opera implements this very strictly.
Nov 5th, 2004, 09:38 AM
oh the joys of web-based development, what browser will actually get everything right....
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.