更快地生成缩略图并写入处理程序中的响应或在 Http 模块中生成并让 IIS 处理程序处理其余的事情?
什么会更快:
- 生成缩略图,然后使用 Http 处理程序将流写入 Http 响应。
- 在 http 模块中针对最早的事件之一生成缩略图,并让 IIS 处理请求的其余部分。
谢谢, 灰。
What will be faster:
- Generate a thumbnail then write the stream to the Http response using an Http Handler.
- Generate a thumbnail in a http module on one of the earliest events and let IIS handle the rest of the request.
Thanks,
Ash.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您在这里得到的任何答案都可能是“什么应该更快”而不是“什么是更快”问题的答案。
要确定哪个更快,您应该尝试一些性能测试。尝试这两种方法,并使用一些会重复调用它们的应用程序,看看哪种方法更快。
Any answer you get here is likely to be an answer to the question "what SHOULD be faster" not "What IS faster".
To determine what is faster, you should try some performance tests. Try both methods, and use some app that will call them repeatedly, and see which is faster.
如果您对如何从 MVC 返回图像以及我针对它运行的一些性能测试感兴趣,我有一个 回答有关从 MVC 返回图像的问题。我没有测试 HTTP 模块。
我的结果是:
If you are interested in how to return an image from MVC and some perf tests I ran against it, I have an answer to a question on returning images from MVC. I did not test HTTP modules.
My results were: