Click here to Skip to main content
Click here to Skip to main content

Enable Gzip compression in IIS 6.0 for ASP.NET 2.0 websites

By , 19 Nov 2008
 

Introduction

This step by step guide will show you how to enable Gzip compression to work with ASP.NET 2.0. Compressing the output should make your websites faster, especially when being viewed via a slow connection.

Step 1: Enable Compression Using the IIS Manager

Expand IIS Manager. Right click on Websites. Click Properties. Click the Service tab. Check the boxes to enable compression.

Step 2: Install IIS 6.0 Resource Kit Tools

You can download the free tool from Microsoft here.

Step 3: Edit IIS Meta Database

Open the IIS Metabase Explorer. It is part of the resource kit you just installed. Expand LM>W3SVC>Filters>Compression. You will need to edit both gzip and deflate. Find the item with the name HcScriptFileExtensions. Add the values aspx, axd, asmx, and css. Repeat process for gzip and deflate. Find HcDynamicCompressionLevel and set it to something higher than 0.

Step 3: Do IISReset

That's it. To verify that you have everything working correctly, you can use the free tool YSlow for Fire Bug.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

ToddHileHoffer
Web Developer
United States United States
Life.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralDid not work for me.membermelihkemal11-Dec-09 3:57 
GeneralRe: Did not work for me.memberToddHileHoffer11-Dec-09 4:05 
GeneralRe: Did not work for me.membermelihkemal11-Dec-09 4:53 
GeneralRe: Did not work for me.memberToddHileHoffer11-Dec-09 4:10 
GeneralRe: Did not work for me.membermelihkemal11-Dec-09 4:56 
GeneralRe: Did not work for me.memberToddHileHoffer11-Dec-09 5:11 
QuestionAny reason why compression may not work?memberMember 33745557-May-09 8:27 
GeneralIIS is Gzipping all files including GIFmemberJRev9-Jan-09 4:01 
GeneralRe: IIS is Gzipping all files including GIFmemberClaus Conrad30-Jan-09 10:11 
GeneralRe: IIS is Gzipping all files including GIFmemberJRev3-Feb-09 7:42 
QuestionYSlowmemberamrelgarhy8119-Nov-08 8:44 
i did exactly what you said in the article step by step, but i see that yslow still saying that GZIP failed, should i do something after setting these value? i just restarted the iis after finish, or should i wait some time?
 
And Also when i opened the files "js, aspx, css" i didn't find any files compressed.
 
Note i set the level of compression to 9
 
Thanks,
AnswerRe: YSlowmemberToddHileHoffer19-Nov-08 11:56 
QuestionRe: YSlowmemberamrelgarhy8119-Nov-08 21:42 
AnswerRe: YSlowmemberToddHileHoffer20-Nov-08 2:11 
QuestionNo Service tabmemberAndre Luiz V Sanches19-Nov-08 6:07 
AnswerRe: No Service tabmemberToddHileHoffer19-Nov-08 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 19 Nov 2008
Article Copyright 2008 by ToddHileHoffer
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid