3

I have created a centralized Image Application for all my other applications.
I have created a http handler in that application for response.
I pass the path of the image in the Query String and in response it find the image and add watermark and send it back in response.
The purpose of this application is to watermark image and send back to the other applications. I am using asp.net with C#.

Now I have a problem on two of my pages in the application I have 15 Image to show.
For this purpose I have to call the handler 15 times.

Is it possible to get response in a single call.
Can I combined those images into one and send back response and using image sprite like feature i adjust the image on the page.All the images are of the same size.

Am I Thinking in the right way or there is any other solution.


Thanks,
Shekhar

sll
  • 61,540
  • 22
  • 104
  • 156
शेखर
  • 17,412
  • 13
  • 61
  • 117

1 Answers1

3

For this purpose I have to call the handler 15 times.

15 requests isn't that many especially if they are made from a clean page with low overall requests.

CSS sprites are undeniably a good practice, but they are usually created for sets of small, static images (great for buttons, icons, etc).

One consideration is the total size of the images. If the resulting sprite is very large, it may degrade the user's experience by making them wait for the entire large image to be processed and downloaded.

Another consideration is how much development effort and computational complexity is involved in determining which images to combine into one.

For a high-traffic reference site, consider the techniques that Yahoo Flickr uses:

  • Sprites for very small images
  • Data URIs for small thumbnails
  • Regular images served from multiple domains for everything else
  • On-demand loading for large lists of images

Summary
From your description, I would probably favor multiple requests combined with lazy loading and as much caching server-side (on the generation of the images) and client-side (via HTTP expire headers) as possible.

Tim M.
  • 53,671
  • 14
  • 120
  • 163