views:

196

answers:

3

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  A: 

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

Nissan Fan
Back in the ASP.Net 1.0 and 1.1 days, many people would use UserControls (ASCX) instead of includes for this reason as well. If you are on 2.0+ and can use masterpages, its the best option for this scenario in my opinion.
JamesEggers
A: 

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.

Mike J
+1  A: 

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.

Jon Seigel