![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XMLHTTPRequest caching problem >Thread Next - Re: XMLHTTPRequest caching problem Re: XMLHTTPRequest caching problemTo: NULL Date: 7/1/2005 3:02:00 PM Any suggestion about how to work around this XMLHTTPRequest caching problem?
Adrian.
BTW Mozilla does the opposite - it always brings the XML files without
caching (although this has been fixed in developer builds).
Adrian Herscu wrote:
> Hi Neil,
>
> Thanks for your fast reply.
>
> I know, there should be a better terminology.
>
> By "static" I meant to a file that is not generated using a
> CGI/ASP/JSP/PHP/ISAPI/...
>
> But all "static" files are updated once in a time. Few examples: CSS
> files are updated in order to bring a new look to the (dynamically
> generated) Web pages, JS files are updated in order to bring new
> behavior to the Web pages, HTML & PDF files are updated because the
> documentation changed, etc., etc., etc.
>
> Then, why XML files are supposed to remain unchanged for the rest of
> their life?
>
> By appending such a "random GET string to the URL" it will defeat the
> caching mechanism, and files will always be retrieved. I need to load
> those files only if they are newer than the cached ones. There is a
> special HTTP header that does exactly that: "if-modified-since".
>
> MS-IE uses this header to bring all ("static") files which are
> _hyperlinked_ from the main HTML file (i.e., scripts, stylesheets, XML,
> XSLT, images, etc.) - because some mysterious reason, MS-XML decides not
> to revalidate it cache.
>
> Any workaround?
>
> Thanks
> Adrian.
>
> Neil Smith [MVP Digital Media] wrote:
>
>> (Q : If it's static, why does it matter if it retrieves from the
>> cache, surely a static file *hasn't* changed, that's what the cache is
>> for !)
>>
>> A : As for all cached files you want to regenerate (e.g. a logging
>> image) append a random GET string to the URL, so for example
>>
>> <script language="javascript1.2">
>> var randomItem=new Date();
>> documentHref=documentHref+'?random='+randomItem.getUTCMilliseconds();
>> // Etc etc
>> </script>
>>
>> On Thu, 23 Jun 2005 00:08:23 +0300, Adrian Herscu
>> <bmf1972@a...> wrote:
>>
>>
>>> Hi all,
>>>
>>> I am using MSXML 3.0 to synchronously load XML documents in the browser.
>>>
>>> Here is a snippet:
>>>
>>> xmlHttpRequest = new ActiveXObject( "MSXML2.XMLHTTP.3.0" );
>>> xmlHttpRequest.open( "GET", documentHref, false );
>>> xmlHttpRequest.send( null );
>>>
>>> documentHref always points to a _static_ XML file.
>>>
>>> This generates no HTTP request - the browser retrieves the file from
>>> its cache.
>>>
>>> Is it possible to make it send a conditional GET?
>>>
>>> Thanks for your time,
>>> Adrian.
>>
>>
>>
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
