473,811 Members | 3,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page Loading slower (ASP.NET Image hosting)

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

response.redire ct("/images/" & request("ImageI D") & ".jpg")

Other sites can now use the following:
<img src="http://www.mysite.com/image.aspx?imag esid=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.
Jul 7 '06 #1
2 1310
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.WriteF ile ( //path to image file).
You can set the ContentType header to the correct image type so the browser
gets what it is expecting.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


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

response.redire ct("/images/" & request("ImageI D") & ".jpg")

Other sites can now use the following:
<img src="http://www.mysite.com/image.aspx?imag esid=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.
Jul 7 '06 #2
Thanks a lot, Peter!

My problem is that all images are located on different servers. So i use
full url to display it in the browser.

response.redire ct("http://www.images1.com/images/image1.jpg")

Can i use Response.WriteF ile with URL as a parameter?

"Peter Bromberg [C# MVP]" wrote:
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.WriteF ile ( //path to image file).
You can set the ContentType header to the correct image type so the browser
gets what it is expecting.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


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

response.redire ct("/images/" & request("ImageI D") & ".jpg")

Other sites can now use the following:
<img src="http://www.mysite.com/image.aspx?imag esid=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.
Jul 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1657
by: Irfan Akram | last post by:
Hi Guys, I asked this question yesterday, but have not yet received a suitable answer. I hope you guys can help me out. I want to load an image on to a web-page. The image is alreday stored in my database. Currently when I load the image on to the page it loads on to the full page using the following code: - Response.ContentType = dr.ToString();
11
345
by: Jeff | last post by:
Hi - I'm trying to get my ASP.NET pages to work the same way on my development machine (running from the VS.NET IDE) and on a remote (3rd-party) server. The only way I've been able to come up with requires changing the page directive for each page between codebehind (for the IDE) and src (for the remote server). While that's a bit annoying for a single page, it's a pretty untenable approach for a website with lots of pages. Is there...
2
4823
by: Frankie | last post by:
I have a user control into which I insert a bunch of controls dynamically. I have it all working just fine - Everything is there on Postback, etc. I load this user control into a hosting ASPX page at runtime during the Page_Load event procedure of the hosting ASPX page. Question: Would it be better to load the user control from the hosting page's OnInit event rather than Page_Load? Does it matter or not? I ask because I understand...
18
2153
by: J-T | last post by:
Hi All, There is a picture on the following URL which I want to have it in one of my asp.net pages .I mean I want to embed the content of this page in my own page and get its image.Is there a control or tecnique which I can accomplish this? http://www.tehrantraffic.com/gif.asp?g=cam3_ttcc_00001.jpg&t=TTCC%20website Thanks a lot
5
3513
by: murrayatuptowngallery | last post by:
I'm caught in a classic finger-pointing situation. My hosting company's server appears to be automatically inserting JS tags into a JS-free html page that has an image inked to a 2nd page with JS. The problem may well be that I am calling JS incorrectly. My host co. insists my ''web publishing software' is doing this. I can prove it isn't by deleting the offending code with an impotent text editor like Notepad, upload it with a WS_FTP...
23
5953
by: Peter | last post by:
I have a problem with a page show_image.asp that returns a jpg image under Windows XP Pro SP2. The page sets content type as: Response.ContentType = "image/jpg" While this works perfectly fine on most machines, on some machines I experience this problem: When loading the page a window pops up that asks if I want to open the document show_page.asp. When I click "Open" Interdev pops up and opens up a
0
2208
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and incurred a network hit per image file. i wanted to avoid the overhead of a separate network connection for each image file, so i bundled all the images into the JAR file. yet, somehow, the loading time for the applet is slower now! i'm totally...
10
13423
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without a problem. I am using chunk_split(data) and the base64_encode and base64_decode on the files. I do a select from the database, and then echo the image (with header(Content Type: image/jpeg) and the decoded image displays fine. Yes, I have...
5
2833
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to look for why it is slowing down. I thought about the DB first and added NOLOCK to a couple of stored procedures that were being run, but with no effect. Can someone offer some tips on where to start looking or how I can begin to diagnose this...
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.