views:

59

answers:

2

Hi there,

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.

A: 

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.

David Stratton
A: 

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
Brian