Closed Bug 65639 Opened 25 years ago Closed 25 years ago

Cache control directives seem to be ignored

Categories

(Core :: Networking: Cache, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jpando, Assigned: neeti)

Details

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt; Hotbar 2.0) BuildID: 20010116 I have the following simple jsp page. If you change the "howdy" text, go to another page (e.g. www.yahoo.com), then hit the Back button to return to the page, the new text is still there. This shouldn't happen because I have set the cache control directive to "no-cache". This problem was not present in Netscape 4.76, but is present in NS 6. This problem is not present in IE5 either. <% response.setHeader("Pragma","no-cache"); response.setHeader("Expires","0"); response.setHeader("Cache-Control","no-store, no-cache"); %> <html> <head> <title>Test</title> </head> <body> <Div id="Test" Style="position:absolute;left:140;top:100;width:100;height:50;visibility:visible "> <Form id="fTest" name="fTest"> <input type="text" size="10" maxlength="10" value="Howdy"> </form> </Div> </body> </html> Reproducible: Always Steps to Reproduce: 1. Change text on jsp page. 2. Go to some other page. 3. Hit back to return to jsp page. Actual Results: The new text is still there. Expected Results: The original text should return since cache-control has been set to "no-cache".
Reporter have you tried this with the latest nightly builds? http://www.mozillazine.org/build_comments/ does the problem still occur?
Note that you are going _back_ to the page. This is not the same as just revisiting it. I believe the current behavior is by design. ccing radha to see whether this is the case.
By default when you go back (on a regular page with no cache control)the form element values are restored to the old value based on the loadtype in nsDocShell::Embed(). In a case like the example here, it looks like, docshell is not getting notified about the "no-cache" situation. Such a notification will most probably from uriloader to nsDocShell::SetLoadType(). When such notification happens, the loadtype should get set to BYPASS_CACHE. When this happens, docshell wouldn't restore form values. cc'ing mscott who can confirm if such a mechanism exists in uriloader.
According to RFC 2616, which specifies HTTP 1.1, the cache control directives are not meant to apply to the history mechanism associated with the "Back" button. I'm marking this INVALID. Here's the quote from RFC 2616: 13.13 History Lists 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 retrieved. By default, an expiration time does not apply to history mechanisms. If the entity is still in storage, a history mechanism SHOULD display it even if the entity has expired, unless the user has specifically configured the agent to refresh expired history documents.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.