Re: IIS 6.0 Not Caching Images
From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 08/04/04
- Next message: David Wang [Msft]: "Re: KB827991 fix doesn't last a full day?"
- Previous message: David Wang [Msft]: "Re: IIS6 web content on remote server question/help"
- In reply to: Joe Rattz: "IIS 6.0 Not Caching Images"
- Next in thread: Joe Rattz: "Re: IIS 6.0 Not Caching Images"
- Reply: Joe Rattz: "Re: IIS 6.0 Not Caching Images"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: David Wang [Msft]: "Re: KB827991 fix doesn't last a full day?"
- Previous message: David Wang [Msft]: "Re: IIS6 web content on remote server question/help"
- In reply to: Joe Rattz: "IIS 6.0 Not Caching Images"
- Next in thread: Joe Rattz: "Re: IIS 6.0 Not Caching Images"
- Reply: Joe Rattz: "Re: IIS 6.0 Not Caching Images"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|