Enabling Http Compression In Iis For Use With Cloudfront
If you create a CloundFront distribution with a custom origin, and your custom origin is a windows server running IIS7 or greater, you may notice that while requests directly to the origin are served with gzip compression, the same url requested through CloudFront will not be compressed. This is because the default configuration for IIS7 does not allow compression when requests are made via proxies.
To fix this, you need to make a change to the
applicationHost.config file on your windows server. This is typically located at
There are few changes that need to be made.
First, locate the existing
<serverRuntime/> node in applicationHost.config and change it to read:
<serverRuntime enabled="true" frequentHitThreshold="1" frequentHitTimePeriod="00:00:20" />
Next, locate the
<httpCompression> node and add the following attributes:
After an IISReset, all requests through CloudFront should now return Gzipped content.
A few links that helped me to this conclusion:
blog comments powered by Disqus