473,770 Members | 4,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IIS Content expiration header and ASP.NET

I have just stumbled upon an what seems to be a very under-rated feature in
IIS - the "Enable Content Expiration" option under a website's properties. I
have an ASP.NET web application that has a lot of subdirectories and each one
has its own set of images (I know its not best design practice, but there is
a business reason behind it). Many pages on the site have quite a few images
and there is a noticeable time lag each time the user navigates across pages,
even when the images are being loaded out of the IE cache. Presumably, this
was IE sending an "if-modified-since" request to the server and waiting for a
304 response before it served the image from the cache, for each image on the
page. Since the images dont change very often, adding an expires or maxage
header to the images would make a very big difference to the users. But how
was I to do it?

Then I thought of trying the "Enable Content Expiration" option in IIS. I
never used before as I thought it applying it on the application, would cause
IE to cache my dynamic ASP.NET pages. And it would be a maintenance headache
to do this for every image directory in the application, and then remember to
do this for every new subdirectory added later.

It turns out my assumption was wrong. After a lot of testing, it emerged
that IIS is smart enough to add the expiration header only to static content.
It automatically adds the header to images and css files, without touching
the aspx pages. This is brilliant! This is a great feature that everybody
should be using! It has made quite a difference to the user experience for
our application, as now images and CSS files are loaded very quickly straight
out of the IE cache.

Unfortunately, it had mixed experiences trying to set this up. I used
Fiddler to check the headers of incoming images and sometimes it would work
straight away, while other times I had to add and remove the option many
times before it finally worked. It was quite frustrating and I am not quite
sure why this was happening. I even tried resetting IIS, but that didnt help.

Also, how does IIS determine what extensions fall under static content? Is
there a way to modify this list?

Does anybody else here have any experience with this feature that they would
like to share?

Thanks
OS
Mar 30 '06 #1
0 1434

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

Similar topics

2
1356
by: F | last post by:
Hi All I am having problem of content expiration it expires immidiately. Real problem is I am replacing some images on mouse over. On every mouse over its downloading images from server that takes time to display, and second thing is its working fine with same aaplication on server1 but when I am putting on server2 its not. I have content expiration checked / unchecked in IIS but no luck
10
2672
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be cross-browser support.for IE (5-6) and browsers derived from Mozilla (varies). Thank you... <%= Clinton Gallagher
1
1975
by: Rudy Mark | last post by:
I have set content expiration in IIS 5.0 to N1 minutes. Also I have code as <meta http-equiv="refresh" content="N2">. Which will be effective in this secnarios ? Which one takes precedence. Rudy Mark
1
3583
by: Mario Hébert | last post by:
I have a simple C# object(class) that I reference in a <OBJECT classid="mydll.dll#nmsp.Ctrl"> tag of an HTML page generated by ASP.net. In a case where the Enable content expiration isn't checked for my website, i can call a public method of the object via javascript and it's working. When the Enable content expiration(immediately) is effective for my website, i always have a javascript error telling me that the object or the method...
0
1133
by: theintrepidfox | last post by:
Dear Group Just noticed that there's a problem with Visual Studio and IIS Content Expiration. I do have a files sub directory and had Contend Expiration set to immediately for that folder. When debugging the application and telling it to open a file in the files folder it does this without problems. However, if I type the file URL (http://localhost/app/files/test.doc)
0
1694
by: TR | last post by:
If mypage.aspx is set to expire immediately using the management console page properties dialog, HttpHeaders tab, -- does the expiration setting take effect as soon as the dialog changes are applied? Assuming mypage.aspx is the first in a sequence of pages, and mysecondpage.aspx comes after it, if the immediate expiration setting is in effect, should clicking on the Back button on mysecondpage.aspx, to return to mypage.aspx, cause...
2
1407
by: Jason Kendall | last post by:
I've noticed that my ASP.Net projects suffer from being cached locally when my users' broswers are set to automatically check for newer pages. Folks will go through the process of 'adding' an item to whatever part of the application they're interacting with and they won't see the new record unless they close the browser or do a CTRL-Refresh or wait some indeterminate amount of time. I set the server to expire content immediately and...
5
1918
by: Frankie | last post by:
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content Expiration -- Expire Immediately? Does it cause the files in the virtual directory to be served on every single browser request even if the files do not change? The reason I ask is that I was having trouble with a css file not getting refreshed in the browser after the css file was updated on the server. In testing I found that I could manually update the css file on...
9
5522
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex http://www.developersdex.com ***
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
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
10002
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
9869
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
6676
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();...
1
3970
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
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.