问题描述
我计划构建一个简单但使用率很高的网络应用程序,并且需要确定一个架构.
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) - 哪个是最轻量级的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!