473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 1416

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

Similar topics

2
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...
10
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...
1
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....
1
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...
0
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. ...
0
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...
2
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...
5
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...
9
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.