X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Firefox is ignoring cache-control directives

Posted

Firefox is not respecting cache-control directives specified in response headers. Below is an example response generated by my application:

Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0 Pragma: no-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/html;charset=ISO-8859-1 Transfer-Encoding: chunked Date: Fri, 25 Jun 2010 16:13:53 GMT

Despite the cache-control: no-cache, and the fact that the page has already expired, when the user navigates away, and then hits the back button, the page is re-displayed from cache. This causes subsequent navigation attempts to fail because the transaction identifiers are stale and have already been used.

This happened

Every time Firefox opened

Additional System Details

Installed Plug-ins

  • -Office Plugin for Netscape Navigator
  • Adobe PDF Plug-In For Firefox and Netscape
  • Default Plug-in
  • Adobe Shockwave for Director Netscape plug-in, version 11.5
  • 3.0.50106.0
  • Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
  • RealPlayer Enterprise(tm) LiveConnect-Enabled Plug-In
  • Next Generation Java Plug-in 1.6.0_17 for Mozilla browsers
  • Npdsplay dll
  • DRM Store Netscape Plugin
  • DRM Netscape Network Object

Application

  • User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4 (.NET CLR 3.5.30729)

More Information

Application Basics
Name
Firefox
Version
3.6.4
Profile Directory
Open Containing Folder
Installed Plugins
about:plugins
Build Configuration
about:buildconfig
Extensions
Name
Version
Enabled
ID
Firebug
1.5.3
true
firebug@software.joehewitt.com
Html Validator
0.8.6.1
false
{3b56bcc7-54e5-44a2-9b44-66c3ef58c13e}
HttpFox
0.8.4
false
{4093c4de-454a-4329-8aff-c6b0b123c386}
Java Quick Starter
1.0
true
jqs@sun.com
JavaScript Debugger
0.9.87.4
false
McAfee SiteAdvisor
1.6.0.109
true
Microsoft .NET Framework Assistant
1.0
false
{20a82645-c095-46ed-80e3-08825760534b}
Total Validator
6.3.0
false
validator@totalvalidator.com
Web Developer
1.1.8
true
YSlow
2.0.7
false
yslow@yahoo-inc.com
Java Console
6.0.17
true
Modified Preferences
Name
Value
accessibility.typeaheadfind.flashBar
0
browser.history_expire_days
0
browser.history_expire_days.mirror
1
browser.link.open_newwindow
1
browser.places.importBookmarksHTML
false
browser.places.importDefaults
false
browser.places.migratePostDataAnnotations
false
browser.places.smartBookmarksVersion
2
browser.places.updateRecentTagsUri
false
browser.startup.homepage
http://redacted/
browser.startup.homepage_override.mstone
rv:1.9.2.4
browser.tabs.loadInBackground
false
browser.tabs.warnOnClose
false
extensions.lastAppVersion
3.6.4
general.useragent.extra.microsoftdotnet
(.NET CLR 3.5.30729)
network.cookie.prefsMigrated
true
places.last_vacuum
1275927725
print.save_print_settings
false
privacy.popups.showBrowserMessage
false
privacy.sanitize.migrateFx3Prefs
true
privacy.sanitize.promptOnSanitize
false
privacy.sanitize.sanitizeOnShutdown
true
security.enable_java
true
security.enable_ssl2
true
security.warn_viewing_mixed
true

S11001001 0 solutions 1 answers

Firefox's cache mechanism doesn't have the same rules as an ordinary cache; in fact RFC 2616 suggests that it would be better to diverge in this sense. From RFC 2616 §13.13:

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.

Jamie Kitson 1 solutions 6 answers

Helpful Reply

I had a similar problem to you and eventually found the following:

Cache-control: no-cache
Cache-control: no-store
Pragma: no-cache
Expires: 0

http://www-archive.mozilla.org/projects/netlib/http/http-caching-faq.html

Modified by Jamie Kitson