Page Loading slower (ASP.NET Image hosting)

G

Guest

I have an image.aspx that accepts 1 parameter (ImageID)
Then in Image.aspx i simply have the following:

response.redirect("/images/" & request("ImageID") & ".jpg")

Other sites can now use the following:
<img src="http://www.mysite.com/image.aspx?imagesid=123">

Now a million dollar question:
If my site's server CPU 100% all sites that use this tag on their pages
will be affected! The page load time will increase dramatically! It is like
it is waiting for the image to load. I don't even want to test it if my site
is completely down, what then will happen? The sites that use this tag will
not load then?

Any idea, suggestion, recommendation? Please.
Thanks in advance.
 
G

Guest

First, I would not use the Page (ASPX) class for this since it represents a
lot of extra un-needed overhead. Use an ASHX handler instead. Then, instead
of performing a redirect which essentially tells the browser to go back and
re-request the image, just do a Response.WriteFile ( //path to image file).
You can set the ContentType header to the correct image type so the browser
gets what it is expecting.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top