473,672 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IIS caching output of pages

Hi,

Our development web server (Win 2003 Server) seems to be caching the
output of various files (CSS and .aspx files) if they have no query
string. The moment you put a question mark in the URL, it's fine.

The problem is that if you modify a file, it still shows you the old
file unless you restart the website or IIS itself. It's definitely not
the browser that's caching the files - IIS is actually serving the wrong
file.

Is there some way to disable this? Why doesn't IIS realise when the file
on it's local filesystem has been modified and reload it?

I had a similar problem once before where my workstation had it's clock
a few minutes into the future, but this time it seems to be a different
problem as now all our machines are synchronised and are set to exactly
the same time.

I'd be greatful if someone can tell me how to solve this very annoying
problem.

Thanks,

Nick...
Nov 18 '05 #1
8 2110
Nick Gilbert <ne**@nickgilbe rt.com> wrote in news:eCip6Vu9DH A.2392
@TK2MSFTNGP11.p hx.gbl:
Our development web server (Win 2003 Server) seems to be caching the
output of various files (CSS and .aspx files) if they have no query
string. The moment you put a question mark in the URL, it's fine.


Have you proven its your webserver and not the browsers, or proxies?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"
Nov 18 '05 #2
Hi Nick,
Thanks for posting in the community!
From your description, you found that the files on your IIS Serve such as
(css or aspx files) are always cached and won't be the latest version if it
is modified and requested by client unless appending querystring after the
request url, yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, the such static files and resources such as images,
css files , js files ...etc are all by default cached on the client in the
temporary foler rather than on the serverside. For example, if a user visit
a certain page and the page contains some images and refernce some certain
css or js files. Then the browser will download these resources and cached
in the local disk and next time the page is refreshed (request again) these
resoures files won't be downloaded again from serverside but retrieved from
local cache disk.
So as for your situation, I think the problem you met is likely caused by
the client's cache. And as you've mentioned that this can be avoided( force
the browser to download the file from serversdie everytime the page is
requested) if you append a querystring(nee d to be different everytime)
after the page's url. So if you'd like the page's refernced resources files
to be downloaded everytime from serverside(the latest version), I think you
can append a tempstamp as querystring after the certain resource file's
url. For example,
if we use a css file as below:
src="common.css "
then now, we replace it as this:
src="common.css ?version=<% timestamp %>"

Thus, everytime the page is requested, the css file will be retireved from
serverside (its latest version). How do you think of this?

In addition ,here are some tech articles on browser's cache:
#HOWTO: Prevent Caching in Internet Explorer
http://support.microsoft.com/?id=234067

#How to Use Pragma: No-cache with IIS and IE
http://support.microsoft.com/?id=165150

Hope they're also helpful.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
Thanks Steven, but it's definitely IIS that's caching the web pages -
not the client. We have verified this by disabling caching in IE,
looking at the pages from other machines or browsers and by telnetting
into the server and looking at the raw HTTP response (which shows the
old data). The *only* way to force the new page to display, is to
restart the website in IIS or reboot the whole server.

Why is IIS (or the file system) caching the pages and how can we stop
this?

Nick...

v-******@online.m icrosoft.com (Steven Cheng[MSFT]) wrote in message news:<ge******* *******@cpmsftn gxa07.phx.gbl>. ..
Hi Nick,
Thanks for posting in the community!
From your description, you found that the files on your IIS Serve such as
(css or aspx files) are always cached and won't be the latest version if it
is modified and requested by client unless appending querystring after the
request url, yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, the such static files and resources such as images,
css files , js files ...etc are all by default cached on the client in the
temporary foler rather than on the serverside. For example, if a user visit
a certain page and the page contains some images and refernce some certain
css or js files. Then the browser will download these resources and cached
in the local disk and next time the page is refreshed (request again) these
resoures files won't be downloaded again from serverside but retrieved from
local cache disk.
So as for your situation, I think the problem you met is likely caused by
the client's cache. And as you've mentioned that this can be avoided( force
the browser to download the file from serversdie everytime the page is
requested) if you append a querystring(nee d to be different everytime)
after the page's url. So if you'd like the page's refernced resources files
to be downloaded everytime from serverside(the latest version), I think you
can append a tempstamp as querystring after the certain resource file's
url. For example,
if we use a css file as below:
src="common.css "
then now, we replace it as this:
src="common.css ?version=<% timestamp %>"

Thus, everytime the page is requested, the css file will be retireved from
serverside (its latest version). How do you think of this?

In addition ,here are some tech articles on browser's cache:
#HOWTO: Prevent Caching in Internet Explorer
http://support.microsoft.com/?id=234067

#How to Use Pragma: No-cache with IIS and IE
http://support.microsoft.com/?id=165150

Hope they're also helpful.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Hi Nick,
Thanks for your response. Based on my further research, there does seems to
have a certain issue on the IIS Server, but it is used to focus on win2000
server, here is the kb article on it:

#FIX: IIS Does Not Refresh the File Cache for Non-Virtual Root Directories
http://support.microsoft.com/?id=329459

Please have a check to see whether it could provide some help or clues on
this issue. In addtion, I've searched some other articles on setting cache
via page's http header:

#How to Modify the Cache-Control HTTP Header When You Use IIS
http://support.microsoft.com/?id=247404

#HOW TO: Prevent Web Caching in Windows 2000
http://support.microsoft.com/?id=311006
Hope they're also helpful.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5
Hi Nick,

Have you had a chance to check out the items I provided in the last reply
or have you got any further ideas on this issue?
If you have any further questions, please feel free to let me know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
Thanks, but these articles pertain to Windows 2000 and we are actually
running Windows Server 2003 Standard Edition. We are still
experiencing this problem so if you have any other ideas, please let
me know!

Nick...

v-******@online.m icrosoft.com (Steven Cheng[MSFT]) wrote in message news:<4n******* *******@cpmsftn gxa06.phx.gbl>. ..
Hi Nick,
Thanks for your response. Based on my further research, there does seems to
have a certain issue on the IIS Server, but it is used to focus on win2000
server, here is the kb article on it:

#FIX: IIS Does Not Refresh the File Cache for Non-Virtual Root Directories
http://support.microsoft.com/?id=329459

Please have a check to see whether it could provide some help or clues on
this issue. In addtion, I've searched some other articles on setting cache
via page's http header:

#How to Modify the Cache-Control HTTP Header When You Use IIS
http://support.microsoft.com/?id=247404

#HOW TO: Prevent Web Caching in Windows 2000
http://support.microsoft.com/?id=311006
Hope they're also helpful.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #7
Hi Nick,

Thank you for the response. Regarding on the issue, I am
finding proper resource to assist you and we will update as soon as posible.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)

Nov 18 '05 #8
Hi Nick,

Thanks for your response. As for the KB, since it is still under reviewing
so we can't get it via the public url. And about the hotfix, it has been
mentioned in it that you need to call the PSS for it:
------------------------------------------------
To resolve this problem immediately, contact Microsoft Product Support
Services to obtain the hotfix. For a complete list of Microsoft Product
Support Services phone numbers and information about support costs, visit
the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;[LN];CNTACTMS:
http://support.microsoft.com/default.aspx?scid=fh;[LN];CNTACTMS

---------------------------------------------------
So the url only provide the address to find the contact info of the PSS.

In addition, have you also checked another suggestions in my former reply?
-------------------------------
In addtion, you should also verify whether or not this is a kernel mode
caching issue you're dealing with by temporarily disabling the kernel mode
cache (UriEnableCache =0, etc.). For details on this, refer to
http://support.microsoft.com/?id=820129.
---------------------------------

Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2131
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. After looking at the use of the OutputCache directive and tinkering with it a bit I found its usability.very limited. Think of it: it is okay for static content. Well that's nice but no big deal. Static content is cheap anyway, the file system...
4
1382
by: Captain Chaos | last post by:
Is it Possible to Cache Pictures JPG/BMP on the Client Browser ? The other Elements of the Page should not being cached because they change. Is it possible to cache parts of a page on the Client but not the whole page
3
1632
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be calculated on the fly when the request is made, and so I thought it would be ideal to cache the page for a set amount of time. I've placed the following at the top of my page: <%@ OutputCache Duration="160" VaryByParam="None" %> Now the problem is...
3
1263
by: moondaddy | last post by:
I have a site where I have only one page and lots of user controls. Rather than passing parameters into the page (mysite/default.aspx?MenuID=123), I pass in a url like this (mysite/products-greenwidgets.aspx). then in the global.asax I intercept the url coming in and convert it to a parameter url like this (mysite/default.aspx?MenuID=greenwidgets). then when the default.aspx page loads, it passes "greenwidgets" to the database and gets a...
10
1463
by: BillGatesFan | last post by:
I'm trying to understand ASP.NET caching. I set the Page Output directive to VaryByParams= None and the duration = 60. Now whenever users hit my web app they can see each others data. Is there anyway to cache the page without this happening or am I using Page Output caching in the wrong situation? It's a data entry web app that I'm trying to increase the performance on.
1
1335
by: Ben Fidge | last post by:
What are best practices for page output caching on pages that are dynamically generated from database tables. Our site has left-hand navigation that is comprised of dynamically generated menus of product categories. The categories are taken from several database tables which rarely change. This left-hand navigation is included on every single page in the site and as such is wrapped up in a user-control. However, when I enabled caching...
5
7846
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated), after some investgation i found out that most of it being consumed by filesystem caching... thanks to Liam and Phil Sherman for their valuable suggestions. Is it safe to turn off filesystem caching on every tablespaceon the server(i.e. DIO) ??...
2
1055
by: UJ | last post by:
We are about to move our web site to be more dynamic - people will be editing things like text strings on a page. This stuff won't change very often. I was wondering if Output Caching would be reasonable so that the pages don't get regenerated every time somebody goes to a page. Would Output Caching be appropriate here? What's a reasonable duration to keep the page cached? I assume that memory becomes an issue as you cache more and more...
2
1824
by: Ken Fine | last post by:
I have a question about ASP.NET output caching. I want to use screen scraping as a temporary hack to pull in some complex Classic ASP-rendered content into some ASP.NET pages: protected String ReadHtmlPage(string url) { WebResponse objResponse; WebRequest objRequest = System.Net.HttpWebRequest.Create(url); objResponse = objRequest.GetResponse();
0
8486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8609
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8683
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7449
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2821
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.