Re: IIS 6.0 Not Caching Images

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 08/04/04


Date: Tue, 3 Aug 2004 19:22:13 -0700

I think you are mis-interpreting what is going on. The log file is not the
correct place to determine whether IIS is caching or not. You observe
caching behavior by watching performance counters (perfmon) or empirically
clocking request round-trip times over a large enough sample size.

A 304 "Not Modified" does NOT indicate that the server cached the response.
It simply indicates that the client asked the server "I'm retrieving this
URL, but I already have a copy of it with the following signature. If this
resource matches that signature, then don't send it again -- I already have
it. Otherwise, please give me the resource".

Thus, a server answers 304 to such questions to tell the client "yup, you've
already got the resource. I'm not sending it to you again". Otherwise, the
server will return 200 with the updated resource as entity body.

Clearly, a 304 (telling the client whether it already has the resource or
not) is completely orthogonal to whether a response is cached or not. If
IIS served out of the cache, you'd see a 200 response with no round-trip to
the slow hard drive. If it didn't serve out of the cache (but also sent no
entity body), then you'd see a 304.

As for what is going on with IIS6 -- IIS6 caches some responses in kernel
mode, and such cached responses are returned as 200 OK. Non-kernel-mode
cached URLs still follow the 304 semantic and has its own user-mode based
caching mechanism.

Finally, it may be possible that you have caching disabled (many things will
disable many types of caching) -- but without looking at performance
counters, it is not possible to confirm.

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Joe Rattz" <joerattz@yahoo.com> wrote in message
news:%23GV099WeEHA.1652@TK2MSFTNGP09.phx.gbl...
I just noticed a difference between my development box running IIS 5.0 and
my production server running IIS 6.0 that seems detrimental to performance.
In IIS 5, my images appear to be getting cached in that the server is
returning an http status code (sc-status from the log) of 304.  Here is a
sample from the log:
14:15:32 127.0.0.1 GET /GPCStoreFront/Images/Collapse.gif 304
14:15:32 127.0.0.1 GET /GPCStorefront/Images/questionmark.gif 304
14:15:32 127.0.0.1 GET /GPCStoreFront/Images/Expand.gif 304
14:15:32 127.0.0.1 GET /GPCStorefront/Images/newuser.gif 304
14:15:32 127.0.0.1 GET /GPCStorefront/Images/addtofavorites.jpg 304
But, in IIS 6, I am getting 200 for images:
2004-08-03 15:26:53 10.28.98.130 GET /GPCStoreFront/Images/Collapse.gif -
80 - 10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
2004-08-03 15:26:53 10.28.98.130 GET
/GPCStoreFront/Images/questionmark.gif - 80 - 10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
2004-08-03 15:26:53 10.28.98.130 GET /GPCStoreFront/Images/Expand.gif - 80 -
10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
2004-08-03 15:26:53 10.28.98.130 GET /GPCStorefront/Images/newuser.gif -
80 - 10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
2004-08-03 15:26:53 10.28.98.130 GET
/GPCStoreFront/Images/addtofavorites.jpg - 80 - 10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
2004-08-03 15:26:53 10.28.98.130 GET /GPCStoreFront/GPCStoreFront.css - 80 -
10.28.11.180
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.0.3705;+.NET+C
LR+1.1.4322) 200 0 0
CSS files are behaving the same way.
Can someone tell me why my images (and CSS file) are not getting cached?
Thanks.


Relevant Pages

  • Re: OWA loses connection to web server
    ... You are correct the resource consumption is likely killing OWA but the real ... OWA on it's own won't do this. ... > The server is an Exchange 2000 Standard, ... This tool automatically recycles IIS processes based on ...
    (microsoft.public.exchange.connectivity)
  • RE: Stop Caching
    ... Hi Jawahar, ... To disable or modify ASP caching on your IIS server, ... Internet Information Server ...
    (microsoft.public.inetserver.iis.security)
  • Re: IIS6 caching
    ... The caching was not in the browser. ... There was no proxy server ... IIS 6 was serving stale content. ... >> a client site or proxy caching issue. ...
    (microsoft.public.inetserver.iis)
  • The resource cannot be found.
    ... Windows 2000 Server and IIS 5. ... Server Error in '/' Application. ... The resource cannot be found. ... Requested Url: /MyApp/MyPage.aspx ...
    (microsoft.public.inetserver.iis.security)
  • Re: IIS log fie showing 200 status code instead of 404
    ... When a user reuests page and resource is not found on web ... server then the web server executes iisstart.htm and not the error404.htm, ... bacause of which the status code logged in IIS log file shows as 200 instead ...
    (microsoft.public.inetserver.iis)

Loading