Server Side Includes vs. ASP.NET Techniques is there a performance difference?

走远了吗. 提交于 2019-12-24 02:04:40

问题


I was recently hired to update an ASP.NET 1.0 site, created before master pages were available. Hence the pages have server side includes (ssi) like <!-- #include file="footer.html" -->. I was about to update the *.aspx pages with a master page that contained the markup previously in the ssi's. I'm convinced this is the right thing to do, especially from a maintainability perspective. However a co-worker firmly believes performance would suffer as supposedly ssi's are a very 'lightweight' technique (his words not mine). I can't find much information regarding performance of one technique versus the other. And if there is, I believe the other advantages of master pages and web controls would still be more important. Your thoughts?


回答1:


In the case of a small static page, I don't know, it's probably pretty close performance-wise. You could run a load test to get some hard numbers and find out.

However, there's really no disadvantage to using a master page, and there are a whole lot of advantages as far as design and management go.




回答2:


SSI would be slower as every call out is an out-of-process request. Master Pages are compiled and very fast in-process actions.




回答3:


Technically the SSI is probably a little faster, because the includes are pulled into the page and compiled into a single class. The MasterPages are a little slower, because they are each compiled into their own class and the page will need to load an instance of that class.

For all practical purposes, the performance gain is probably almost negligible and the benefits of the MasterPage and Web Controls probably make up for any performance loss.



来源:https://stackoverflow.com/questions/1652103/server-side-includes-vs-asp-net-techniques-is-there-a-performance-difference

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