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

Posted on 2008-11-06
Last Modified: 2012-06-21
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?

Question by:jabcoco
    LVL 3

    Accepted Solution

    I found an interesting article for your answer, please go through it

    LVL 10

    Author Comment

    Perfect, thanks...
    would you also told me why i should use "ashx" intead of a normal relative server path to display images?
    LVL 3

    Assisted Solution

    ashx basically means 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.
    LVL 10

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now