Wednesday, March 30, 2011

Enabling Expires Header on IIS7

Open up IIS Manager,

1. Locate the folder where files (e.g. js, css and images) are located and needed to be configured with Expires Headers.
2. Click on HTTP Response Headers
3. Under Action page, click Set Common Headers
4. By default, "Enable Http keep-alive" is checked. Leave this as it is.
5. Another tickbox "Expire Web content", ensure this is checked. You can set the expires as long as required.

Monday, March 28, 2011

GZIP

Today, i have been trying to get GZIP compression working for my local machine which runs IIS7 with Windows 7. For some reasons GZIP compression isnt working even though i have checked the applicationhost.config and mime type has been configured correctly.

Turn out the issues requires additional tweak.

Compression is 'locked' by default at the application level. As such, it needs to be 'unlocked'. this can be achieved via the command line or via the (extra download) iis7 admin tools.

eg. appcmd set config -section:urlCompression /doDynamicCompression:true

http://learn.iis.net/page.aspx/206/dynamic-compression/

Reference:

http://serverfault.com/questions/23788/need-help-with-some-iis7-web-config-compression-settings