By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

XMLHttpRequest in FireFox and cache (Part 2)

P: n/a
Martin Honnen wrote:
You can set HTTP request headers if you need to
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'file.xml', true);
httpRequest.setRequestHeader('Cache-Control',
'desired cache value here')


if you send
httpRequest.setRequestHeader('Cache-Control', 'public'); or
httpRequest.setRequestHeader('Cache-Control', 'max-age=3600, public');
you get :
Cache-Control: (max-age=3600,) public, no-cache
Firefox just adds to any Cache-Control header the 'no-cache' string
This apparently disables the cache.
(about:config cache setting is ignored.)
Watching the protocol with the tamper extension you can see
that firefox sets LOAD_BACKGROUND, LOAD_BYPASS_CACHE and
INHIBIT_CACHING flags.
LOAD_BACKGROUND seem to be related to async mode of images and
http_requests

any solutions?

Andres Obrero

Aug 7 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VK
> Firefox just adds to any Cache-Control header the 'no-cache' string
This apparently disables the cache.


Yup...

Go to bugzilla.mozilla.org and look for "timed download privacy
exploit".

My wild guess would be that they hash-hash "fixed" this exploit in sich
rude way. Hopefully they will come with something *much* better in the
next milestone.

Aug 7 '05 #2

P: n/a

warteschlange wrote:
if you send
httpRequest.setRequestHeader('Cache-Control', 'public'); or
httpRequest.setRequestHeader('Cache-Control', 'max-age=3600, public');
you get :
Cache-Control: (max-age=3600,) public, no-cache
Firefox just adds to any Cache-Control header the 'no-cache' string
This apparently disables the cache.
(about:config cache setting is ignored.)


I think there is a bug on this on https://bugzilla.mozilla.org/ that is
now fixed in the nightly trunk builds (e.g Mozilla 1.8 nightly or Deer
Park nightlies):
<https://bugzilla.mozilla.org/show_bug.cgi?id=268844>
I don't think you can change anything with XMLHttpRequest in Mozilla
1.7.x respectively Firefox 1.0.x releases, there you will have to live
with broken caching.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 7 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.