ASP.NET MVC vs. Webforms vs. HTTP Handlers (.ashx) - which is the most lightweight?(ASP.NET MVC vs. Webforms vs. HTTP Handlers (.ashx) - 哪个是最轻量级的?)
问题描述
我计划构建一个简单但使用率很高的网络应用程序,并且需要确定一个架构.
I plan on building a simple, yet high usage webapp and need to settle on an architecture.
- 基本的服务器端逻辑/动态数据库驱动内容大约六到十几页的服务都说内容
- 无需重写 URL,
- 非常简单的页面流程/路由
我们的目标是发布此应用以使用尽可能少的带宽、内存和 CPU.也就是说,我的选择是
The objective is to publish this app to use the least amount of bandwidth, memory, and CPU as possible. That said, my options are to
在 ASP.NET MVC 中构建
build in ASP.NET MVC
使用视图状态构建网络表单禁用
build in webforms with viewstate disabled
使用 .ashx 处理程序和代码构建连接所有 HTML 输出变成它吐出的字符串
build using .ashx handlers with code that concatenates all HTML output into strings that it spits out
哪个是最轻量级的解决方案?
我很感激到目前为止的回复,但我不要求最好的解决方案.这是一个简单的应用程序,我想要一个使用最少机器/网络资源的解决方案.
I appreciate the responses so far, but i'm not asking for the best solution. This is a simple app, and i want the solution that will use the fewest machine/network resources.
推荐答案
HttpHandlers 是最轻量级的,因为 ASHX 文件背后的接口是 IHttpHandler,它是 Web Forms 和 MVC 都使用的 Page 对象的基础.
HttpHandlers are the most light weight, because the interface behind the ASHX file is IHttpHandler which is the basis of the Page object that is used both for Web Forms and MVC.
这篇关于ASP.NET MVC vs. Webforms vs. HTTP Handlers (.ashx) - 哪个是最轻量级的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ASP.NET MVC vs. Webforms vs. HTTP Handlers (.ashx) - 哪个是最
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
