Re: InternetOpenUrl and local cache (2)
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Wed, 5 Mar 2008 11:43:39 -0800
This behavior is by design. It's a direct consequence of you specifying
INTERNET_FLAG_RESYNCHRONIZE. Here's what RFC2626 has to say about
status code 304:
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.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Si" <blueturtle@xxxxxxxxxxx> wrote in message
news:6e03f482-0829-44de-806c-c3a2067c3374@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm using InternetOpenUrl, with the flags INTERNET_FLAG_RESYNCHRONIZE
| INTERNET_FLAG_NO_UI, to access a file on a web server.
In the web server, the file is defined to expire after 2 days.
I see 2 behaviors that I don't understand, and I hope someone can
help.
__Issue 1__
After the 1st download, the file is stored in the temporary files
folder.
If I try to "InternetOpenUrl" during the 2 days before expiration,
I've expected that there will not be an access to the web server,
However I see (using Fiddler), that there is an access to the web
server with result 304.
Is there a way to avoid this access before expiration, so only local
cache is used ?
__ Issue 2__
In the previous scenario, although I see "304" in Fiddler,
HttpQueryInfo returns "200".
How can I get the real value ?
(Maybe this issue will be resolved after the 1st one is)
Thanks for any help,
Si.
.
- Follow-Ups:
- References:
- InternetOpenUrl and local cache (2)
- From: Si
- InternetOpenUrl and local cache (2)
- Prev by Date: Re: WSAWaitForMultipleEvents wait of > max events techniques
- Next by Date: Re: How to create multiple http sessions?
- Previous by thread: InternetOpenUrl and local cache (2)
- Next by thread: Re: InternetOpenUrl and local cache (2)
- Index(es):
Relevant Pages
|