Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Relative or Full Path

Reply
Thread Tools

Relative or Full Path

 
 
EYEBUZZ
Guest
Posts: n/a
 
      02-03-2004

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
 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      02-03-2004
On 03 Feb 2004 00:13:47 GMT, http://www.velocityreviews.com/forums/(E-Mail Removed) (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
 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      02-03-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
os.path.walk() to get full path of all files dude Python 5 03-17-2011 09:09 AM
FileUpload control doesn't work (fail in client side early stages) when path is relative i.e "\\path.." Oren ASP .Net 1 04-29-2007 04:20 PM
How do I convert an absolute path into a relative path Nigel Wilkinson Ruby 2 07-25-2005 07:37 PM
absolute path versus relative path in JSP Matt Java 3 07-08-2004 08:31 PM
Make a relative url path from an absolute path to another one Thomas Guettler Python 3 10-27-2003 04:41 PM



Advertisments