服务器端包含与 ASP.NET 技术之间是否存在性能差异?

发布于 2024-08-09 01:15:25 字数 293 浏览 4 评论 0原文

我最近受聘更新 ASP.NET 1.0 站点,该站点是在母版页可用之前创建的。因此,这些页面具有服务器端包含 (ssi),如 。我打算使用包含先前在 ssi 中的标记的母版页来更新 *.aspx 页面。我相信这是正确的做法,特别是从可维护性的角度来看。然而,一位同事坚信性能会受到影响,因为据说 ssi 是一种非常“轻量级”的技术(他的话不是我的话)。我找不到太多关于一种技术与另一种技术性能的信息。如果有的话,我相信母版页和 Web 控件的其他优势仍然会更重要。你的想法?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

又怨 2024-08-16 01:15:25

SSI 会比较慢,因为每次调用都是进程外请求。母版页经过编译且非常快速的进程内操作。

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

冰雪之触 2024-08-16 01:15:25

对于小型静态页面,我不知道,它在性能方面可能非常接近。您可以运行负载测试来获取一些硬数据并找出答案。

然而,使用母版页实际上没有任何缺点,而且就设计和管理而言还有很多优点

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.

自由范儿 2024-08-16 01:15:25

从技术上讲,SSI 可能更快一点,因为包含内容被拉入页面并编译成单个类。 MasterPages 有点慢,因为它们都被编译成自己的类,并且页面需要加载该类的实例。

出于所有实际目的,性能增益可能几乎可以忽略不计,MasterPage 和 Web 控件的好处可能弥补任何性能损失。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文