IIS Server - IIS keeps pages cached, whatever.

This is Interesting: Free IT Magazines  
Home > Archive > IIS Server > June 2005 > IIS keeps pages cached, whatever.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author IIS keeps pages cached, whatever.
Daniel Kaplan

2005-06-27, 5:53 pm

OK we're running our website on IIS 6.
today i tried to upload a new javascript file to the website.
I went to view the website to check whether the update had taken place.
When the web page loaded i found that the new javascript was not being run.
We've had this problem before so i went into IIS on the server and stopped
and started the site.
Nothing, the old Javascript was still displayed.
I then deleted the javascript file completely from the server and restarted
the site.
Still the old javascript was displayed (despite me having deleted this script)

I checked from the web server terminal to make sure the files had been
deleted, and they had.

I then tried stopping and starting ALL sites on the web server, using the
command:
net stop iisadmin

followed by net start w3svc

still the old script was displayed

i then uploaded the new javascript again and set the expiration time to
immediate on both the javascript and the page that called it

i restarted the site again

still the old javascript was displayed.

Finally i set the whole site to expire immediatly and restarted the site.
No surprises here, the old script was still there.

Help, There's got to be a way to get my script to update

I'd really rather not turn the server off as we are a multinational company,
we have 14 websites being run on the server and the marketing dpartement will
open me a new port if they notice i've taken down every website the company
has.
Kristofer Gafvert [MVP]

2005-06-27, 5:53 pm

Hello,

In almost all cases when this happens, it is because of a client side
cache.

If you upload the js-file, and request it directly using a non-caching
client (for example WFetch from IIS 6.0 resource kit tools), do you get
the old, or the new file?

Also make sure that you empty the cache in your client, if you choose to
use that.


--
Regards,
Kristofer Gafvert (IIS MVP)
www.gafvert.info - My Articles and help
www.ilopia.com


Daniel Kaplan wrote:

> OK we're running our website on IIS 6.
> today i tried to upload a new javascript file to the website.
> I went to view the website to check whether the update had taken place.
> When the web page loaded i found that the new javascript was not being

run.
> We've had this problem before so i went into IIS on the server and

stopped
> and started the site.
> Nothing, the old Javascript was still displayed.
> I then deleted the javascript file completely from the server and

restarted
> the site.
> Still the old javascript was displayed (despite me having deleted this

script)
>
> I checked from the web server terminal to make sure the files had been
> deleted, and they had.
>
> I then tried stopping and starting ALL sites on the web server, using the
> command:
> net stop iisadmin
>
> followed by net start w3svc
>
> still the old script was displayed
>
> i then uploaded the new javascript again and set the expiration time to
> immediate on both the javascript and the page that called it
>
> i restarted the site again
>
> still the old javascript was displayed.
>
> Finally i set the whole site to expire immediatly and restarted the site.
> No surprises here, the old script was still there.
>
> Help, There's got to be a way to get my script to update
>
> I'd really rather not turn the server off as we are a multinational

company,
> we have 14 websites being run on the server and the marketing dpartement

will
> open me a new port if they notice i've taken down every website the

company
> has.

Daniel Kaplan

2005-06-27, 5:53 pm

I've cleared my client side cache several times, i've tried it on other PCs

"Kristofer Gafvert [MVP]" wrote:

> Hello,
>
> In almost all cases when this happens, it is because of a client side
> cache.
>
> If you upload the js-file, and request it directly using a non-caching
> client (for example WFetch from IIS 6.0 resource kit tools), do you get
> the old, or the new file?
>
> Also make sure that you empty the cache in your client, if you choose to
> use that.
>
>
> --
> Regards,
> Kristofer Gafvert (IIS MVP)
> www.gafvert.info - My Articles and help
> www.ilopia.com
>
>
> Daniel Kaplan wrote:
>
> run.
> stopped
> restarted
> script)
> company,
> will
> company
>

Kristofer Gafvert [MVP]

2005-06-27, 5:53 pm

In IIS, caching can be at either kernel-mode, or user-mode.

HTTP.sys caches responses in the kernel-mode cache. For a file to get into
this cache, it has to be accessed twice within 10 seconds (default). Every
120 seconds a flush algorithm runs, clearing out files that have not been
accessed within 120 seconds. This flush algorithm is also run whenever IIS
receives a change notification for a file.

To clear this cache, you can restart HTTP.sys by typing this in a command
prompt:

NET STOP /y HTTP

After that, start the W3SVC service.

The user-mode cache is in the worker process. So to clear that cache, all
you need to do is restart the worker process, which will happen if you
restart the W3SVC service as you have already done. And of course, this
cache is also cleared for any file that is changed. It also clears out
files that has not been accessed for 30 seconds (default value).

Beyond that, there is a file system cache. A reverse proxy can also cache
the file, ISPs may cache files and regular proxy can cache files.

May i ask where the file is stored? On the local file system, or a remote
machine?


--
Regards,
Kristofer Gafvert (IIS MVP)
www.gafvert.info - My Articles and help
www.ilopia.com


Daniel Kaplan wrote:

> I've cleared my client side cache several times, i've tried it on other

PCs[vbcol=seagreen]
>
> "Kristofer Gafvert [MVP]" wrote:
>
to[vbcol=seagreen]
place.[vbcol=seagreen]
being[vbcol=seagreen]
this[vbcol=seagreen]
been[vbcol=seagreen]
using the[vbcol=seagreen]
to[vbcol=seagreen]
site.[vbcol=seagreen]
dpartement[vbcol=seagreen]
Daniel Kaplan

2005-06-28, 7:50 am

i'm afraid that this did not fix the problem. I must admit it's quite
worrying that the problem is still there 24 hours later. usually a few
restarts of IIS fixes the problem.
it's odd because when i go and log onto the web server (physically stand
infront of it and connect through the terminal) and look in windows explorer
the files are all correct and up to date. it's just IIS that see's the old
ones.

To answer your queston. the files are stored locally on the web server.

Basically we use a content management system, and rather than giving users
direct access to the website (we don't trust them) we have identical copies
of the websites located on our intranet server. the users update these
copies, then at 5am every morning a batch file is run to copy the files
accross from the intranet server to the web server. For some reason IIS still
keeps it's cache after the files are copied across (yes we have checked that
we did infact copy the pages accross from the intranet server to the web
server).

How do you clear the file system cache.

If i find a solution i'll let you know

"Kristofer Gafvert [MVP]" wrote:

> In IIS, caching can be at either kernel-mode, or user-mode.
>
> HTTP.sys caches responses in the kernel-mode cache. For a file to get into
> this cache, it has to be accessed twice within 10 seconds (default). Every
> 120 seconds a flush algorithm runs, clearing out files that have not been
> accessed within 120 seconds. This flush algorithm is also run whenever IIS
> receives a change notification for a file.
>
> To clear this cache, you can restart HTTP.sys by typing this in a command
> prompt:
>
> NET STOP /y HTTP
>
> After that, start the W3SVC service.
>
> The user-mode cache is in the worker process. So to clear that cache, all
> you need to do is restart the worker process, which will happen if you
> restart the W3SVC service as you have already done. And of course, this
> cache is also cleared for any file that is changed. It also clears out
> files that has not been accessed for 30 seconds (default value).
>
> Beyond that, there is a file system cache. A reverse proxy can also cache
> the file, ISPs may cache files and regular proxy can cache files.
>
> May i ask where the file is stored? On the local file system, or a remote
> machine?
>
>
> --
> Regards,
> Kristofer Gafvert (IIS MVP)
> www.gafvert.info - My Articles and help
> www.ilopia.com
>
>
> Daniel Kaplan wrote:
>
> PCs
> to
> place.
> being
> this
> been
> using the
> to
> site.
> dpartement
>

William Tasso

2005-06-28, 7:50 am

Daniel Kaplan"" <DanielKaplan@discussions.microsoft.com> wrote:

> ...
> we did infact copy the pages accross from the intranet server to the web
> server).
>
> How do you clear the file system cache.


FWIW: I have seen this problem exactly once on IIS6

> If i find a solution i'll let you know


Yes, that would be good. A system recycle worked for us, but something a
little less drastic would be useful.

--
William Tasso
Kristofer Gafvert [MVP]

2005-06-28, 5:54 pm

As far as i know, you cannot clear the file system cache unless you reboot
the machine. But i am not an expert on how the file system in Windows
works.


--
Regards,
Kristofer Gafvert (IIS MVP)
www.gafvert.info - My Articles and help
www.ilopia.com


Daniel Kaplan wrote:

> i'm afraid that this did not fix the problem. I must admit it's quite
> worrying that the problem is still there 24 hours later. usually a few
> restarts of IIS fixes the problem.
> it's odd because when i go and log onto the web server (physically stand
> infront of it and connect through the terminal) and look in windows

explorer
> the files are all correct and up to date. it's just IIS that see's the

old
> ones.
>
> To answer your queston. the files are stored locally on the web server.
>
> Basically we use a content management system, and rather than giving

users
> direct access to the website (we don't trust them) we have identical

copies
> of the websites located on our intranet server. the users update these
> copies, then at 5am every morning a batch file is run to copy the files
> accross from the intranet server to the web server. For some reason IIS

still
> keeps it's cache after the files are copied across (yes we have checked

that[vbcol=seagreen]
> we did infact copy the pages accross from the intranet server to the web
> server).
>
> How do you clear the file system cache.
>
> If i find a solution i'll let you know
>
> "Kristofer Gafvert [MVP]" wrote:
>
into[vbcol=seagreen]
Every[vbcol=seagreen]
been[vbcol=seagreen]
IIS[vbcol=seagreen]
command[vbcol=seagreen]
all[vbcol=seagreen]
cache[vbcol=seagreen]
remote[vbcol=seagreen]
other[vbcol=seagreen]
side[vbcol=seagreen]
non-caching[vbcol=seagreen]
you get[vbcol=seagreen]
choose[vbcol=seagreen]
and[vbcol=seagreen]
time[vbcol=seagreen]
the[vbcol=seagreen]
multinational[vbcol=seagreen]
the[vbcol=seagreen]
David Wang [Msft]

2005-06-29, 7:52 am

If the following does not "flush" the cache, the issue is not with IIS:
NET STOP /y HTTP & NET START W3SVC

All cache resources are associated with w3wp.exe, and when w3wp.exe goes
down, all in-process state (including cache) is destroyed. w3wp.exe also
flushes the HTTP.SYS kernel cache when it winds down. Even if w3wp.exe is
killed or unexpectedly terminated, HTTP.SYS will detect this and flush the
associated kernel cache entries.

Is the content being served by the w3wp.exe process on a local harddrive to
the process, or is it a UNC / network share?

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"William Tasso" <spamblocked@tbdata.com> wrote in message
news:op.ss2vkum33jnr2w-wnt@tbdata.com...
Daniel Kaplan"" <DanielKaplan@discussions.microsoft.com> wrote:

> ...
> we did infact copy the pages accross from the intranet server to the web
> server).
>
> How do you clear the file system cache.


FWIW: I have seen this problem exactly once on IIS6

> If i find a solution i'll let you know


Yes, that would be good. A system recycle worked for us, but something a
little less drastic would be useful.

--
William Tasso


Trent Jones

2005-06-29, 5:53 pm

Whenever I have seen this happen, somebody is usually editing the files in
the wrong location!

- SG

"Daniel Kaplan" <Daniel Kaplan@discussions.microsoft.com> wrote in message
news:BB922390-52F8-4B8D-BB65-D04910638482@microsoft.com...
> OK we're running our website on IIS 6.
> today i tried to upload a new javascript file to the website.
> I went to view the website to check whether the update had taken place.
> When the web page loaded i found that the new javascript was not being
> run.
> We've had this problem before so i went into IIS on the server and stopped
> and started the site.
> Nothing, the old Javascript was still displayed.
> I then deleted the javascript file completely from the server and
> restarted
> the site.
> Still the old javascript was displayed (despite me having deleted this
> script)
>
> I checked from the web server terminal to make sure the files had been
> deleted, and they had.
>
> I then tried stopping and starting ALL sites on the web server, using the
> command:
> net stop iisadmin
>
> followed by net start w3svc
>
> still the old script was displayed
>
> i then uploaded the new javascript again and set the expiration time to
> immediate on both the javascript and the page that called it
>
> i restarted the site again
>
> still the old javascript was displayed.
>
> Finally i set the whole site to expire immediatly and restarted the site.
> No surprises here, the old script was still there.
>
> Help, There's got to be a way to get my script to update
>
> I'd really rather not turn the server off as we are a multinational
> company,
> we have 14 websites being run on the server and the marketing dpartement
> will
> open me a new port if they notice i've taken down every website the
> company
> has.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com