防止 ASP.NET GET 请求超时?
我有一个提供 MP3 内容的 ASP.NET 应用程序,但该内容是在请求期间生成的,并且可能会将响应第一个字节的发送延迟几分钟。
客户端是一个 podcatcher(我不知道是哪个),我见过的最低超时是 20 秒。也就是说,假设没有回应,这些客户(相当合理)会相对较快地放弃。
我怎样才能让这些客户不放弃?我怎样才能让他们知道即将收到回复?
I've got an ASP.NET application that serves MP3 content, but that content is generated during the request and can delay the sending of the response's first byte by several minutes.
The client is a podcatcher (I don't know which), and the lowest timeout I've seen is 20 seconds. That is, these clients are (reasonably enough) giving up relatively quickly, assuming there's no response coming.
How can I keep these clients from giving up? How can I let them know a response is coming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您以二进制格式提供内容,则应该能够在组织二进制内容之前格式化标头并立即将其推出。如果您使用处理程序,则可以通过避免大量 IIS 开销来加速该过程,同时您可以启动内容标头(未完成,但已启动)并使用 Response.Flush()把他们救出来。
If you're serving up the content in a binary format, you should be able to format the headers and push them out right away before you even have the binary content organized. If you're using a handler, you can speed up the process by avoiding a lot of IIS overhead, and at the same time you can get the content-headers started (not completed, but started) and use a Response.Flush() to get them out.