.NET Daily

ASP.net

Front-End Performance Tips for ASP.NET Websites – Add Response Headers

Posted on .

Front-End Performance Tips for ASP.NET Websites – Add Response Headers

Introduction

There are quite few methods to do this. You can set the Expire Headers directly from IIS, you can write a custom HttpHandler or if you don’t want custom functionality you can set them from Web.config file.

Below you have an example of how you can set the expiration date from Web.config:

<system.webServer>
    <staticContent>
        <clientCache cacheControlMaxAge="30.00:00:00"
 cacheControlMode="UseMaxAge"/>
    </staticContent>
</system.webServer>

The first number from cacheControlMaxAge field is the number of days. That is also the default value that I keep on my websites.

Note: In order to get an A grade from YSlow plugin, you have to set the value to more than 7 days.

Firebug - Response Headers

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

View Comments (0) ...
Navigation

Privacy Preference Center