Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - IIS Content expiration header and ASP.NET

 
Thread Tools Search this Thread
Old 03-30-2006, 03:36 PM   #1
Default 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


=?Utf-8?B?bW9oZG93YWlz?=
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
viewstate MAC failed in asp.net 2.0 while postback the page azraffarveen Software 0 05-12-2009 03:24 PM
How do i use frameset in asp.net avinash parate Software 2 12-31-2008 03:29 AM
.NET 2.0 Web Apps / .NET 3.5 ASP.NET Apps - Differences/Similariti london1919 MCTS 1 12-08-2008 03:16 PM
ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) msandlana Software 0 04-25-2008 06:37 AM
ASP.NET 2.0 application does not run in WIN2k3 johnfraj Software 0 04-19-2007 08:27 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46