Initial setup for a new ASP.NET MVC site in IIS7

Background Over the years, I have spent far too many hours running the same set of commands against ASP.NET and ASP.NET MVC sites to bring them up to what I consider a starting point. Most of the time, I have to refresh myself about how to do at least one of them. This is a list of those commands in a central location for myself and anyone else to use. As with any good instructions, there is no guarantee you won’t completely destroy your server, site, or soul using these commands. I can only say they worked for me once. Remove unnecessary HTTP headers Server X-Powered-By X-AspNet-Version X-AspNetMvc-Version Adding dynamic content compression (e.g., GZIP) GZIP for JSON and JSONP content types (e.g., “application/json”) Complete appcmd command-line list Remove unnecessary HTTP headers By default, IIS and ASP.NET give you a few headers in each and every HTTP response sent out. Server: Microsoft-IIS/7.5 (or 7.0, or whatever IIS version you have) X-Powered-By: ASP.NET X-AspNet-Version: 4.0.303319 (or 2.0.50727, or 1.1.4322, or whatever version you have) X-AspNetMvc-Version: 3.0 (or 2.0, or 1.0, or whatever version you have) People will rant and rave about removing these headers for security and whether that helps. I am… Continue reading