Re: IIS 6.0 caching Image Files when we don't want it

From: Robin Shaw (robin.shaw_at_nospam.oboron.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 10:18:06 +0100

Not sure.

I fixed the issue by modifying your suggested resolution.

I've disabled static file caching on the specific folder where the images
are generated and the app is now working.

Thanks again

Robin

"David Wang [Msft]" <someone@online.microsoft.com> wrote in message
news:%23yVysAkfEHA.3316@TK2MSFTNGP10.phx.gbl...
> 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
> >
> >
> >
>
>
>


Loading