Re: Default Caching HTTP Headers in xmlhttp

Adrian Herscu <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Jeremy Hartley wrote:
> I am using xmlhttp to retrieve a very large static xml file. I really 
> want this to be cached, so that the load time of my application is as 
> small as possible, however Mozilla's default HTTP Headers seem to be 
> made to frustrate this effort, by switching off any caching. .
> 
> See the code below and a description of its results for more details.
> ___________________________________________
> 
> xmlhttp = new XMLHttpRequest();
>     
> xmlhttp.open("GET", "huge.xml",true);
> xmlhttp.onreadystatechange=function() {
>     if (xmlhttp.readyState==4) {
>         alert(xmlhttp.responseText);
>     }
> }
> 
> xmlhttp.send(null);
> 
> ________________________________________________
> 
> This code will produce a GET Request with the following HTTP headers: 
> Cache-Control: no-cache
> Pragms: no-cache
> 
> This disables any caching. I don't want this at all. I have tried to 
> override the values using commands like.
> 
>     xmlhttp.setRequestHeader('Cache-Control', '');
>     xmlhttp.setRequestHeader('Pragma', '');
> 
> This has no effect at all.
> 
> Another attempt:
> 
> xmlhttp.setRequestHeader('Cache-Control', 'Hello');
> xmlhttp.setRequestHeader('Pragma', 'Hello');
> 
> Produces the following HTTP Headers:
> Cache-Control: Hello, no-cache
> Pragms: Hello, no-cache
> 
> Which still seems to override any ability to use the caching data.
> 
> If anybody has any useful ideas or explanation for this behavior please 
> don't hesitate to contact me.
> 
> Kind regards,
> 
> Jeremy Hartley

I have the same problem - could not find anything helpful yet.
Anybody there knows how to solve this?

Thanks for your time,
Adrian.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.