Re: InternetOpenUrl and local cache (2)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • [REVS] Introduction to HTTP Response Splitting
    ... single HTTP request that forces the web server to form an output stream, ... one response. ... HTTP response splitting is a fairly new web application vulnerability. ... Web cache poisoning: In this form a rather larger defacement takes place ...
    (Securiteam)
  • Re: How to clean up routing cache?
    ... I actually need criteria that shows that DNS response is slow. ... The local cashing of response disturbs the picture since the timeout ... value for the cache seems longer than i am going to do probing... ... > And even if your host did not cache the negative answer, ...
    (comp.unix.solaris)
  • Re: strlen(), K+1: clarification
    ... Note the 'is said to' tactic, diverting attention away from the fact ... and responsible C programmers generally avoid non-CT- ... And if you have to work with strings longer than cache length, ... Trying to cut off the easy response of 'memory is the bottleneck' by ...
    (comp.programming)
  • 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)
  • Re: [PHP] dynamic -> static
    ... You can cache your code using PHP Accelerator or Turck ... implementing a caching layer between your application and your database. ... 404 causes it to error out regardless of the content of the response. ... with any caching system as above - finding and flushing stale data. ...
    (php.general)