更快地生成缩略图并写入处理程序中的响应或在 Http 模块中生成并让 IIS 处理程序处理其余的事情?

发布于 2024-08-11 23:02:26 字数 135 浏览 4 评论 0原文

什么会更快:

  • 生成缩略图,然后使用 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 技术交流群。

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

发布评论

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

评论(2

萝莉病 2024-08-18 23:02:26

您在这里得到的任何答案都可能是“什么应该更快”而不是“什么是更快”问题的答案。

要确定哪个更快,您应该尝试一些性能测试。尝试这两种方法,并使用一些会重复调用它们的应用程序,看看哪种方法更快。

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.

梦幻的心爱 2024-08-18 23:02:26

如果您对如何从 MVC 返回图像以及我针对它运行的一些性能测试感兴趣,我有一个 回答有关从 MVC 返回图像的问题。我没有测试 HTTP 模块。

我的结果是:

  • MVC:每张照片 7.6 毫秒
  • 静态:每张照片 6.7 毫秒

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:

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