I have an asp.net application that streams PDFs to the browser in 64kb
chunks, looping through until all the PDF is streamed out. Here's a few lines
to help you get the picture (at bottom of this post)
My question is that I'm going to measure the time that this code takes to
run and log it to see how things are performing. However, what will this
measurement actually be representing?
a) The time it takes for the whole data of the PDF to reach the client.
b) same as a) but additional time it takes for the Adobe Reader to load and
display (which is usually slow)
c) Something else, i'm missing the point?
Any help of thoughts greatly appreciated here! Thanks all.
ps. if the answer is b) is it actually possible to measure a)?
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", System.Convert.ToString(document.Size));
Response.AddHeader("Accept-Header", System.Convert.ToString(document.Size));
byte[] buffer = new byte[documentStreamer.BlobBufferSize];
while ((buffer = documentStreamer.StreamBytes()).Length != 0)
{
//Write straight back to browser....
Response.OutputStream.Write(buffer, 0, buffer.Length);
Response.Flush();
}
documentStreamer.Close();
Response.End();
-- bruce (sqlwork.com)
Just so I understand then, when this code finishes, the data could still be
on its way to the client and the PDF may not actually be visible yet?
"bruce barker" wrote:
> .
>
Notes on time-taken:
http://blog.jonathanroussel.com/2009/03/iis-5-and-6-time-taken-information.html
Fiddler:
http://www.fiddler2.com/fiddler2/
To see if the Adobe Reader plugin is being slow, you could try a different
one, like Foxit Reader.
Andrew
> To see if the Adobe Reader plugin is being slow, you could try a different
> one, like Foxit Reader.
That's an excellent suggestion, IMO.
The Foxit reader outperforms the Adobe reader many times over, has virtually
none of the Adobe "bloat", and supports an MDI interface:
http://www.foxitsoftware.com/downloads/index.php
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
"Mark Rae [MVP]" wrote:
> .
>