What is the best way to optimize a Windows Server 2008 box running IIS7 to serve only static files?

旧时模样 提交于 2019-12-05 02:50:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!