470,815 Members | 1,287 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

XMLHttpRequest in FireFox and cache (Part 2)

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
2 3189
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

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.

Similar topics

6 posts views Thread by Chris Smith | last post: by
3 posts views Thread by Sergey Surkov | last post: by
13 posts views Thread by TLaufenberg | last post: by
5 posts views Thread by Peter Michaux | last post: by
1 post views Thread by Iain Adams | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.