问题
I would like to have our web applications pull static content (css, js, images) from a static file server running Windows Server 2008 and IIS7.
What sort of optimizations would you make to the server for this single purpose?
(Machine.config changes? Web.config changes? Special IIS7 setup or modules? What?)
回答1:
Some advices:
- Enable gzip compression: http://blogs.msdn.com/vivekkum/archive/2009/02/18/http-compression-in-iis-6-and-iis-7-using-service-account.aspx
- Set Cache-Control: max-age to 31536000 (1 year). code.google.com will tell you why --> http://code.google.com/speed/page-speed/docs/caching.html. This link will tell you how --> http://consultingblogs.emc.com/jonathangeorge/archive/2009/09/09/how-to-improve-your-yslow-score-under-iis7.aspx
回答2:
There is an article on Microsoft Technet describing a configuration for static hosting.
But basically you need to add a specific role service for hosting static content.
I am unsure if you have done this, but for optimization the serverfault crowd will most likely have more of an answer for you.
来源:https://stackoverflow.com/questions/1539748/what-is-the-best-way-to-optimize-a-windows-server-2008-box-running-iis7-to-serve