Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Convincing XMLHTTP.3.0 to refresh a fresh resource

From: RichF@-----------.---------.---
To: NULL
Date: 4/5/2007 6:52:00 AM

"Anthony Jones" wrote:

> 
> "Rich-F" <RichF@d...> wrote in message
> news:EE64C55B-B026-46E7-8974-FE8FAAE1C0A4@m......
> > "Anthony Jones" wrote:
> >
> > >
> > > "Rich-F" <RichF@d...> wrote in message
> > > news:61C826B1-E1F2-4E6F-87FF-83C675E9FDF4@m......
> > > > "Anthony Jones" wrote:
> > > > <snip>
> > > >
> > > > > The point I was trying to communicate is that a browser offers the
> user
> > > the
> > > > > opportunity to override the normal operation of the local cache by
> using
> > > the
> > > > > refresh button.  This causes all requests to fulfill the page to
> pass
> > > > > through local cache to the origin server regardless of whether there
> is
> > > > > fresh instance of the resource in the cache.
> > > > >
> > > > > I'm trying to implement a similar feature for resources that have
> been
> > > > > fetched with XMLHTTP.  For performance reasons I do not want to send
> a
> > > > > request every time it's needed however I want to offer the user the
> same
> > > > > 'refresh' option.
> > > > <snip>
> > > >
> > > > Just considering this last point.....
> > > >
> > > > The only method that worked reliably for me was adding the
> > > If-Modified-Since
> > > > header and making sure that the date I used was definitely older than
> any
> > > > timestamp that might be associated with the file.  (I used IE6 and
> > > > XMLHTTP.3.0)
> > >
> > > Ok thanks for the input.  However since changing the If-Modified-Since
> in
> > > that way would always result in 200 response from the server and never a
> 304
> > > it's the same is simply using the the load method on a DOM with
> ForceResync
> > > enabled which is what I was hoping to avoid.
> >
> > (we're going round in circles here)
> 
> Yes we are
hmmmmm.
> 
> >
> > If you want to absolutely force the request to go to the server then set
> > If-Modified-Since to something really old.
> >
> > If you want to give the server a chance to reply with a 304 then set
> > If-Modified-Since to the 'real' modified date as per my previous code
> example.
> 
> Your previous code example knew what the 'real' modified date is from a
> previous fetch. As I pointed out in response to that; trapping, persisting
> and retrieving that piece of information is a complication way beyond the
> worth of the feature.

Sometimes, to achieve a simple result you have to put in a disproportionate 
amount of leg-work.

> I've also already stated that I'm not seeing the results in my testing that
> you appear to be.
> I've tried setting the If-Modified-Since header but it doesn't force a round
> trip to the server.

Works for me.

>This is as I would expect, the modification date of a resource has no bearing on the resources age in the cache.

The wording of that sentence suggests to me that you've misunderstood the 
effect/purpose of the header.

The overall tone of your responses indicates that you know enough to solve 
this by yourself, - the best of luck to you.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent