Creating a seperate static content site for IIS7 and MVC

Posted by JK01 on Server Fault See other posts from Server Fault or by JK01
Published on 2012-09-28T01:19:48Z Indexed on 2012/09/28 3:40 UTC
Read the original article Hit count: 220

With reference to this serverfault blog post: A Few Speed Improvements where it talks about how static content for stackexchange is served from a separate cookieless domain...

How would someone go about doing this on IIS7.5 for a ASP.NET MVC site?

The plan so far:

  • Register domain eg static.com, create a new website in IIS
  • Manually copy the js / css / images folders from MVC as is so that they have the same paths on the new server
  • Enable IIS gzip settings (js/css = high compression, images = none)
  • Set caching with far future expiry dates
  • <clientCache cacheControlCustom="public" /> in the web.config
  • Never set any cookies on the static.com site
  • Combine and minimize js / css
  • Auto deploy changes in static content with WebDeploy

Is this plan correct?

And how can you use WebDeploy to deploy the whole web app to one server and then only the static items to another?

I can see there is a similar question, but for apache: Creating a cookie-free domain to serve static content so it doesn't apply

© Server Fault or respective owner

Related posts about iis7

Related posts about gzip