IIS 7.5 optimizations for a site serving only static content

Solution 1:

There are several considerations in this, some which are handled on IIS (HTTP compression, caching headers fx), and some which are handled during the build process / before deployment (such as Javascript and CSS file concatenation & whitespace minification).

As such, it's a bit hard to give you a complete rundown in one answer, as some of it will depend on your build & release methods. In high level steps:

  • The site is "cookieless" by virtue of you using a new domain, one that is not tied to your webapplication. Since you're not setting any cookies for the domain (using f.x. .NET application code), it's then "cookieless".

  • You should absolutely enable HTTP compression for static text content such as Javascript and CSS.

  • I'm not the greatest IIS administrator, but as far as I can tell, you only need the default IIS components associated with the basic "Web Server (IIS)" server role.

  • You should absolutely enable long caching headers for the static content. The general recommendation is 31 days, but you can set it higher or lower. Remember, if you serve static content with long cache headers, then you must change the URL if you change the file, to avoid old cached content being re-used by the clients.

  • You should enable HTTP keep-alive (same docs as caching headers).

In addition to this, there are pre-deployement tasks, such as whitespace compressing the Javascript and CSS, and ideally compress PNG's better, etc. This is were your development tools and build cycle helps decide how to proceed.

When you're done, try downloading a few files from your static servers with YSlow enabled. I find that the "Classic V2" ruleset gives the biggest impact for the effort, so I would suggest check your score against this YSlow ruleset.

Of the "Classic V2" ruleset, these rules apply cleanly to your static server IIS instances & content:

3. Add an Expires or a Cache-Control Header
4. Gzip Components
10. Minify JavaScript and CSS
11. Avoid Redirects
13. Configure ETags
19. Use Cookie-Free Domains for Components
22. Make favicon.ico Small and Cacheable

Solution 2:

There's a very interesting write up here where someone is using IIS to serve static files. It mainly concentrates on tweaking the IIS file caching settings to limit disk activity (which was his bottleneck). He says he's seen a 20x increase in performance.