views:

205

answers:

1

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?

+3  A: 

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.

Joel Etherton
It never occurred to me that sending the headers would mitigate the timeout risk. That seems so reasonable. Now to do more reading...
lance
Depending on the reception platform (I've never dealt with podcatcher), you might need to continue flushing even the binary data in increments just to keep the target client "interested".
Joel Etherton
My testing showed that sending the headers did not prevent the timeout. As you say, that might change "depending on the reception platform."
lance