Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1988
  • Last Modified:

How and why using a image handler (ashx) instead of webrelative path to display images?

Actually we only have 1 front-end server, but planning to move into a webfarm with multiple front-end server and 1 access point datastorage("SAN/SAS") to stores all the photos/videos.

Actually we simply use <img src="/images/somepath/image.jpg"> to display the image on client site. But we will not be able to do so eventually cause we are moving into webfarm and datastorage.

Someone told me that i need to create a "Image Handler (ashx)" who return the images.

What about the performance and memory load of using a image handler to display images. And what about "file lock" if 2 front-end server try to send back the same images?

Any example?

Thanks!!!
0
jabcoco
Asked:
jabcoco
  • 2
  • 2
2 Solutions
 
AswinKrishnanCommented:
I found an interesting article for your answer, please go through it

http://www.wrox.com/WileyCDA/Section/id-291916.html


0
 
jabcocoAuthor Commented:
Perfect, thanks...
would you also told me why i should use "ashx" intead of a normal relative server path to display images?
0
 
AswinKrishnanCommented:
ashx basically means asp.net simple handler files, if you use image handlers then you can prevent Bandwidth leeching,Compress the images there by save bandwidth,reduce the load on the Server and reduce the page load time.

Bandwidth leeching happens when you have an image hosted on your site and another site links directly to your image using an <img> tag. The page serves from the other site, but the image is served from yours. Browsers typically include the name of the host that obtained the request. Images that are requested from your web server by a page hosted elsewhere will have a referrer header that doesn't match your site's URL.
0
 
jabcocoAuthor Commented:
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now