Relative or Full Path

Discussion in 'HTML' started by EYEBUZZ, Feb 3, 2004.

  1. EYEBUZZ

    EYEBUZZ Guest

    Hi,

    When one uses a full path URL for an image (or javascript or whatever)
    ("http://www.host.com/images/photo1.jpg") versus a relative one
    ("images/photo1.jpg"):

    1) is there any difference in the time it takes to receive the image in the
    browser?

    2) Any difference in caching the image so it's already loaded on subsequent
    pages?...ie does it force the image to fully reload each time?

    3) Any reason not to use the full path, other than it adds just that much more
    code (hence file size) to an HTML file?

    Thanks,
    Eye
     
    EYEBUZZ, Feb 3, 2004
    #1
    1. Advertising

  2. EYEBUZZ

    Mark Parnell Guest

    On 03 Feb 2004 00:13:47 GMT, (EYEBUZZ) declared in
    alt.html:

    > Hi,


    G'day.

    >
    > When one uses a full path URL for an image (or javascript or whatever)
    > ("http://www.host.com/images/photo1.jpg") versus a relative one
    > ("images/photo1.jpg"):
    >
    > 1) is there any difference in the time it takes to receive the image in the
    > browser?


    I doubt it, except maybe the extra half a micro-millisecond it takes to
    parse the extra few bytes in the address. :)

    >
    > 2) Any difference in caching the image so it's already loaded on subsequent
    > pages?...ie does it force the image to fully reload each time?


    Not AFAIK.

    >
    > 3) Any reason not to use the full path, other than it adds just that much more
    > code (hence file size) to an HTML file?
    >


    If you change your domain, you have to change all of the links (easy
    enough with a find and replace tool, but better not to have to do it at
    all).

    Also, when you are testing locally, it will always download the images
    from the web, rather than local.

    Personally, I use absolute URLs (/images/foo.png) rather than relative
    (../../../images/foo.png). I find them much easier to manage. :)

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Feb 3, 2004
    #2
    1. Advertising

  3. EYEBUZZ wrote:
    > When one uses a full path URL for an image (or javascript or whatever)
    > ("http://www.host.com/images/photo1.jpg") versus a relative one
    > ("images/photo1.jpg"):
    >
    > 1) is there any difference in the time it takes to receive the image in the
    > browser?


    I suppose there would be some slight difference in processing time, but
    I can't imagine it being even slightly noticable.

    > 2) Any difference in caching the image so it's already loaded on subsequent
    > pages?...ie does it force the image to fully reload each time?


    Doubt it.

    > 3) Any reason not to use the full path, other than it adds just that much more
    > code (hence file size) to an HTML file?


    If you change domain names, you'll have to change all of your images later.
     
    Leif K-Brooks, Feb 3, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    3
    Views:
    19,579
    Sudsy
    Jul 8, 2004
  2. Thomas Guettler
    Replies:
    3
    Views:
    765
    Andrei
    Oct 27, 2003
  3. Oren
    Replies:
    1
    Views:
    554
    Michael D. Ober
    Apr 29, 2007
  4. dude
    Replies:
    5
    Views:
    1,720
    Jussi Piitulainen
    Mar 17, 2011
  5. Nigel Wilkinson
    Replies:
    2
    Views:
    390
    Nigel Wilkinson
    Jul 25, 2005
Loading...

Share This Page