Re: IIS 6.0 caching Image Files when we don't want it
From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 08/09/04
- Next message: David Wang [Msft]: "Re: IIS 6 Session Restarts"
- Previous message: MJS: "login error"
- In reply to: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Next in thread: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Reply: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 9 Aug 2004 11:20:35 -0700
Well, your application does not sound like it is cache friendly, so maybe
you had accidentally disabled caching on IIS4 somehow. Does the FileSystem
containing your web content support FileChangeNotification?
Basically, the decision to do static file caching works like this:
1. IF Static File Caching is not disabled (W3SVC/DisableStaticFileCache is
not set to 1 or HTTP.Sys Registry key is not set)
2. AND the request does not match these criteria for "non-cacheable":
http://www.microsoft.com/resources/documentation/IIS/6/all/techref/en-us/iisRG_SCA_26.mspx
3. THEN the request is cached
What you can do is enable the static file cache globally, and then on a
per-site basis, configure something to the request that makes it
non-cacheable (according to the above URL). For example, add a do nothing
ISAPI Filter for that site, and it'll turn off static file caching for just
that site.
-- //David IIS This posting is provided "AS IS" with no warranties, and confers no rights. // "Robin Shaw" <robin.shaw@nospam.oboron.com> wrote in message news:O0WsUthfEHA.1652@TK2MSFTNGP09.phx.gbl... Thanks for this David The exact same application was migrated from IIS 4.0 running on NT Server 4.0 to Win 2003 IIS 6.0. Does this mean IIS 4.0 wasn't caching properly? Disabling static file cache does indeed solve the problem but affects other sites on the server. Is it possible to configure IIS to not cache static files on a site by site basis? Robin "David Wang [Msft]" <someone@online.microsoft.com> wrote in message news:OPiii9BfEHA.3520@TK2MSFTNGP10.phx.gbl... > It sounds like your 3rd party component and your application is incompatible > with caching because it is dynamically creating images that end up with the > same URL (filename is based on session ID, which probably stays the same > throughout the session in question) but DOES NOT have the same content. But > there is no way for a web server to know the image was created dynamically > since you're accessing it like a static file. > > If the 3rd party component dynamically creates an image with a unique > filename and the URL which retrieves it stays constant, after 3 requests to > the same URL within 10 seconds, the URL's content will be automatically > cached by IIS. This is absolutely reasonable because HTTP is stateless, so > when someone accesses a URL like "/images/foobar12345.gif" , it is expected > that if you access the exact same URL 30 seconds later, the same content > should come back. If that is not the case, it is the responsibility of the > component to declare itself "not cache friendly". > > So, it looks like your application is incompatible with caching. The > resolutions I can think of are: > 1. Keep caching and use an application that is compatible with caching > 2. Disable caching > > I think it's the static file response cache that is conflicting for your > configuration: > CSCRIPT %SYSTEMDRIVE%\inetpub\adminscripts\ADSUTIL.VBS SET > W3SVC/DisableStaticFileCache 1 > NET STOP /y HTTP & NET START W3SVC > > This will stop the static file cache from working. > > Bottom line: > I do not think the problem is "IIS6 caching Image Files when we don't want > it" -- the problem is that your application is not telling IIS6 that it is > not cache friendly -- thus the responsibility is on the user to disable any > caches that conflict with the application. > > -- > //David > IIS > This posting is provided "AS IS" with no warranties, and confers no rights. > // > "Robin Shaw" <robin.shaw@nospam.oboron.com> wrote in message > news:OzRSB$5eEHA.632@TK2MSFTNGP12.phx.gbl... > Hi > > We're migrating an application from IIS 4.0 to IIS 6.0 on Win2003 Server. > > The application uses a 3rd party component to dynamically create images and > assigns the filename to the Users SessionID. > > The page displays the correct image for the first 3 or 4 times but from then > on serves up the last image all the time. > > I've changed the browser settings to check the page every page visit. We do > not use a proxy server and when accessing the image directly from the server > it serves up the last image not the latest image. Howerver, when viewing the > image from explorer on the server the 3rd party component creates the > correct image. It's as if the server is caching the image but we can't > understand why it works for the first 3 or 4 hits and then stops working. > > We've set enable content expiration to immediate on the web site as well and > added Cache-Control : no-cache to the headers. > > Anyone else encountered this or has a resolution would be much appreciated. > > Thanks > > Robin > > >
- Next message: David Wang [Msft]: "Re: IIS 6 Session Restarts"
- Previous message: MJS: "login error"
- In reply to: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Next in thread: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Reply: Robin Shaw: "Re: IIS 6.0 caching Image Files when we don't want it"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|