0

I am having an issue with Firefox storing cache, even though I explicitly state not to. I have this in my code for .jsp, .html, and template.html

<head>
   <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, max-age=0" />
   <meta http-equiv="Pragma" content="no-cache" />
   <meta http-equiv="expires" content="0" />
   <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00 GMT" />
</head>

While it seems to be making a difference, as I can navigate away from the page, and (sometimes) it will bring me to my login page, logging out and back in produce errors. [RPC Fault faultString="login required before authorization can proceed." But then it will bring me through to my homepage apparently logged in, but without any data.

I don't understand this because it works fine in IE, and also this is https, so I don't see why any cache is ever getting stored anyway. Please help!

Also, I cannot ask users to disable browser history, even though this seems to "fix" the issue.

I tried the following to change the HTTP header, but I am not sure if this is the correct way because it didnt' work. I put this at the top of my .jsp.

 <%
 response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
 response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
 response.setDateHeader("Expires", 0); // Proxies.
 %>
MO2
  • 1
  • 2
  • This sounds more like a cookie issue than a cache issue. – Pointy May 22 '13 at 19:09
  • Kinda makes sense, but isn't an SSL connection supposed to disable cookies too, or do I have to state in my code not to store cookies? If so, how? – MO2 May 22 '13 at 19:49
  • Nevermind. I tried just deleting cookies and just deleting cache, and it only worked when I deleted cache. – MO2 May 22 '13 at 19:55
  • I tested the application, and there were cache files when I used Firefox. – MO2 May 23 '13 at 14:32
  • Perhaps [this question may help](http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers). Note bobince's answer, wherein he points out that it's better to do this with HTTP headers instead of `` tags. – Pointy May 23 '13 at 14:40
  • There's a Firefox add-on called [Tamper Data](https://addons.mozilla.org/en-us/firefox/addon/tamper-data/) that will show you lots of information about each HTTP transaction. That might help diagnose problems setting your headers. – Pointy May 23 '13 at 15:29
  • Unfortunately, I am behind an intranet with this application, and cannot use add-ons. I did notice that it was not getting rid of the cache, like it should have been. – MO2 May 23 '13 at 15:37

0 Answers0