Re: xmlhttp caching



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.)


.



Relevant Pages

  • Re: Problems with access to a web page
    ... Server: Apache ... Connection: close ... Look what I get now when I send the exact same request ... and got exactly the same 0 length response ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: BASIC authentication Issues with IE - Part II - Solved but WHY?
    ... REQUEST and RESPONSE logging below to show you whats going on. ... using my local machine web server. ... However, at this point I am logged in and I have lots of links, one is a "who is online" link client?who.wcn, which I will open this up in a second window. ...
    (microsoft.public.inetserver.iis.security)
  • Re: NotificationSampleWebDav-Monitor OWA Inbox
    ... when you send your authentication cookies along a request in the ... the response should also contain new cookies. ... Can you guide me how can I update the cookie with new response. ... Warning: Exiting Action with an exception: The remote server returned ...
    (microsoft.public.exchange.applications)
  • Re: HTTP header processing sequence
    ... Initially it sends the request for the html source, and if there are any more objects to request it does so, and then wait for the server to reply sending back the requested data using appropriate headers. ... How does the (browser) client know how to match up multiple received responses from the server with GET-requests, as this does not appear to be sequential. ... So the association of request and response is no problem. ...
    (microsoft.public.win32.programmer.networks)
  • Re: 70-305 question still waiting...
    ... and franlky I do not care much where the cache ... > method, request header fields, and the response status indicate that it is ... > following Cache-Control response directives allow an origin server to ...
    (microsoft.public.cert.exam.mcsd)