Re: xmlhttp caching
- From: dNagel <NOTGrandNagel@xxxxxxxxxxx>
- Date: Sat, 25 Mar 2006 00:29:31 -0800
There's got to be something in the servers response codes.
You have status and statusText... try examining them as the
xml request progresses... it just may be that the server is
spitting back a 204 (no content)or a 304 (not modified)
I notice you're doing a GET which means that a 304 is a very
likely response...
heres the details...
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
10.3.5 304 Not Modified
If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.
The response MUST include the following header fields:
- Date, unless its omission is required by section 14.18.1
If a clockless origin server obeys these rules, and proxies and clients add their own Date to any response received without one (as already specified by [RFC 2068], section 14.19), caches will operate correctly.
- ETag and/or Content-Location, if the header would have been sent
in a 200 response to the same request
- Expires, Cache-Control, and/or Vary, if the field-value might
differ from that sent in any previous response for the same
variant
If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers.
If a 304 response indicates an entity not currently cached, then the cache MUST disregard the response and repeat the request without the conditional.
If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response.
hth,
D.
Josef Dabernig wrote:
isn't there a way to achieve proper caching?.
this "add timestamp to url" workarround works fine but i would expect server side caching to work... if you know what i mean!?
"Steven Cheng[MSFT]" wrote:
Hi Praveen,
As dNagel has mentioned, we can use an additional querystring parameter to make the xmlhttp component or browser retrieve the data from server-side. Also, if you do not want the request always be made to server to retrieve data, you can consider manually control the querstring paramerr's value not to be randomly generated. You can define your custom algorithm to create such parameter. Thus, when you do not want the request be made to server(but utilize the cache), you can make the parameter value the same with former requests.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no rights.)
- References:
- xmlhttp caching
- From: Praveen
- Re: xmlhttp caching
- From: dNagel
- Re: xmlhttp caching
- From: Praveen
- Re: xmlhttp caching
- From: Steven Cheng[MSFT]
- xmlhttp caching
- Prev by Date: Re: List of functions jscript
- Next by Date: Re: xmlhttp caching
- Previous by thread: Re: xmlhttp caching
- Next by thread: Re: xmlhttp caching
- Index(es):
Relevant Pages
|