Web Performance – IIS GZip Compression

There’s nothing like performance tuning your website and watching benchmarks better themselves. Sometimes it can be tricky but fortunately this is one of the easier fixes. YSlow and Chrome Dev tools recommend gzip compression and you are looking at around a 70% reduction in file size for your static and dynamic resources. Great! So how do we do it?

First of all this blog post applies to IIS7 and above. IIS7 has Dynamic Content Compression un-installed so install it by heading to Windows Features.

enableDynamicCompression

In your solution, add the following config to your web.config:

<urlCompression doDynamicCompression="true" />

You can check your dynamic content is now being compressed with gzip by looking at the response header in fiddler, firebug or chrome developer tool:

gzip_response

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s