IIS Tuning
Optimize IIS performance alongside mod_pagespeed 1.1. Static vs dynamic gzip, MIME types, CDN integration, Application Request Routing, and TCP slow start.
This guide covers IIS-specific performance tuning that complements mod_pagespeed 1.1 optimization. These settings are configured through IIS Manager or web.config, not through pagespeed.config.
Gzip compression
Static vs dynamic compression
IIS supports two types of gzip compression: static (pre-compressed files cached to disk) and dynamic (compressed on the fly). When mod_pagespeed is active, disable static compression and enable dynamic compression:
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="true" />
</system.webServer>
Why disable static compression? mod_pagespeed rewrites resource URLs with content hashes. Static compression caches compressed files by URL, but mod_pagespeed’s URL rewriting means the compressed cache is rarely hit. Dynamic compression handles the constantly changing URLs more efficiently.
Gzip MIME types
Add MIME types for file formats that benefit from compression but are not compressed by IIS by default:
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".svgz" />
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
CDN integration
Gzip through proxies
By default, IIS disables compression for HTTP/1.0 clients and proxied requests. CDNs typically use HTTP/1.1 but may present a Via header that triggers IIS’s proxy detection. Override this behavior:
<system.webServer>
<httpCompression noCompressionForHttp10="false" noCompressionForProxies="false" />
</system.webServer>
CORS headers for CDN-served fonts
If your CDN serves web fonts from a different domain, browsers require CORS headers. Add the Access-Control-Allow-Origin header:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
Restrict the value to your specific domain instead of * if your security policy requires it.
Application Request Routing (ARR)
ARR turns IIS into a reverse proxy with disk-based caching. When combined with mod_pagespeed, ARR can cache optimized resources at the edge and reduce load on the backend.
How it works with mod_pagespeed
- mod_pagespeed’s
extend_cachefilter rewrites cacheable resource URLs to include content hashes, extending their cache lifetime to one year. - ARR caches these long-lived resources. After the first request, subsequent requests are served directly from ARR’s disk cache without reaching the backend.
- The backend handles only dynamic HTML responses and cache misses.
Setup
Install ARR through the Web Platform Installer or download it from Microsoft. Key configuration:
- Enable disk caching in ARR’s proxy settings
- Set the cache drive to an SSD for best performance
- Configure the backend server farm to point to your mod_pagespeed-enabled application servers
ARR respects standard Cache-Control headers. mod_pagespeed sets appropriate caching headers on optimized resources automatically.
TCP slow start
TCP slow start controls how quickly a new connection ramps up its sending rate. A larger initial congestion window (ICW) allows more data in the first round trip, which benefits page load times.
Windows Server 2016 and later
Windows Server 2016 defaults to an initial congestion window of 10 (ICW10). No configuration change is needed.
Windows Server 2012
Set ICW10 using elevated PowerShell:
New-NetTransportFilter -SettingName Custom -LocalPortStart 80 -LocalPortEnd 80 -RemotePortStart 0 -RemotePortEnd 65535
New-NetTransportFilter -SettingName Custom -LocalPortStart 443 -LocalPortEnd 443 -RemotePortStart 0 -RemotePortEnd 65535
Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionProvider CTCP
This creates custom TCP settings for ports 80 and 443 with ICW10 and Compound TCP (CTCP) as the congestion provider.
See also
- Getting Started — IIS installation guide
- Configuration — general configuration reference
- IIS Configuration — pagespeed.config format reference