Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 01-11-2005, 13:00   #1 (permalink)
shawn
Civilians

 
Default difference between relative path and full URL

Hi,

My question is does anyone know the difference between specifying a relative
path such as
<img src="images/myimg.gif"> and full URL
<img src="http://mysite.com/images/myimg.gif">?

Does the second one issue an additional http request? if so, i have all my
images in a page with full URL, will that slow down the page download time?

Best of all, is it possible to deliver both text/html and image/gif in one
http request? I suspect that typically they are separate requsts to the
server, right?

Any pointer or insight would be appreciated.

Shawn


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 01-11-2005, 13:00   #2 (permalink)
Spartanicus
Civilians

 
Default Re: difference between relative path and full URL

"shawn" <shawn@noemail.nowhere.com> wrote:

>My question is does anyone know the difference between specifying a relative
>path such as
><img src="images/myimg.gif"> and full URL
><img src="http://mysite.com/images/myimg.gif">?
>
>Does the second one issue an additional http request?


The same for both.

>if so, i have all my
>images in a page with full URL, will that slow down the page download time?


Full urls require a few more bytes in the code, other than that, no.

>Best of all, is it possible to deliver both text/html and image/gif in one
>http request? I suspect that typically they are separate requsts to the
>server, right?


Most servers support http 1.1 pipe lining nowadays.

--
Spartanicus
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-11-2005, 14:00   #3 (permalink)
GreyWyvern
Civilians

 
Default Re: difference between relative path and full URL

On Tue, 11 Jan 2005 11:46:15 -0500, shawn <shawn@noemail.nowhere.com>
wrote:

> Hi,
>
> My question is does anyone know the difference between specifying a
> relative path such as
> <img src="images/myimg.gif"> and full URL
> <img src="http://mysite.com/images/myimg.gif">?
>
> Does the second one issue an additional http request? if so, i have all
> my
> images in a page with full URL, will that slow down the page download
> time?


Both will be treated the same by the client; all requests will be made
separately. Some servers support pipelining, which means all the requests
will be sent via the same socket connection, but still, each and every
request is sent (unless the client decides or is told not to).

> Best of all, is it possible to deliver both text/html and image/gif in
> one http request?


Technically yesh, but why complicate things? Why would you want to do
this?

> I suspect that typically they are separate requsts to the
> server, right?


Almost without exception.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-11-2005, 16:00   #4 (permalink)
Karim
Civilians

 
Default Re: difference between relative path and full URL

On Tue, 11 Jan 2005 11:46:15 -0500, shawn wrote:

> Hi,
>
> My question is does anyone know the difference between specifying a relative
> path such as
> <img src="images/myimg.gif"> and full URL
> <img src="http://mysite.com/images/myimg.gif">?
>
> Does the second one issue an additional http request? if so, i have all my
> images in a page with full URL, will that slow down the page download time?
>
> Best of all, is it possible to deliver both text/html and image/gif in one
> http request? I suspect that typically they are separate requsts to the
> server, right?
>
> Any pointer or insight would be appreciated.
>
> Shawn


They both work but you should use relative paths. If you change the domain
name or copy the files to another site, you have renaming to do.

Karim
--
http://www.cheapesthosting.com - Innovative Web Hosting since 1998
Spam and Virus protected email - Online calendars with email notification
Camera phone photos automatic transfers to your photo album (RSS Enabled)
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-11-2005, 17:00   #5 (permalink)
Justin Koivisto
Civilians

 
Default Re: difference between relative path and full URL

Karim wrote:

> They both work but you should use relative paths. If you change the domain
> name or copy the files to another site, you have renaming to do.


That depends on your setup really... All I'd have to do is change the
domain name in a config file, and all absolute paths would be updated
automatically.

--
Justin Koivisto - justin@koivi.com
http://www.koivi.com
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-11-2005, 18:00   #6 (permalink)
nospam@geniegate.com
Civilians

 
Default Re: difference between relative path and full URL

shawn <shawn@noemail.nowhere.com> wrote:
> Hi,
>
> My question is does anyone know the difference between specifying a relative
> path such as
> <img src="images/myimg.gif"> and full URL
> <img src="http://mysite.com/images/myimg.gif">?
>
> Does the second one issue an additional http request? if so, i have all my
> images in a page with full URL, will that slow down the page download time?


It's generally better to use relative paths whenever possible because
you can move the pages easier, maintenance is easier, and it's just
cleaner.

Images and static content may be some-what different depending on scale,
If you've got: /app/somefile.cgi and /img/somefile.gif and are working
on a HUGE scale, doing an http://img.example.com/img/somefile.gif and
http://app.example.com/app/somefile.cgi MAY be better because
it allows you to setup a web server optimized for static content
and another server optimized for applications. (Could do the same
with your app server configuration too though)

Web servers that are strictly configured to serve static content, with no
support for CGI, authentication, paths, re-writing or any other goodies can be
a lot faster and easier on system resources. In those extreme cases, I wouldn't
even recommend apache for static content.

In most cases, it's not worth the trouble. (Totally pointless if you can't run
multiple web servers on your ISP - And unless you've got root access, or an ISP
willing to do this, you can't)

Generally, it's better to use relative paths, it'll make your
life a lot easier if you do. (Especially if you work on the
pages offline or elsewhere)

> Best of all, is it possible to deliver both text/html and image/gif in one
> http request? I suspect that typically they are separate requsts to the
> server, right?


Depends on how the browser and web server are setup, they can be sent in
the same request, but I normally tell my browser not to do that because
it's kind of buggy.

Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-11-2005, 20:00   #7 (permalink)
Karim
Civilians

 
Default Re: difference between relative path and full URL

On Tue, 11 Jan 2005 20:54:34 GMT, Justin Koivisto wrote:

> Karim wrote:
>
>> They both work but you should use relative paths. If you change the domain
>> name or copy the files to another site, you have renaming to do.

>
> That depends on your setup really... All I'd have to do is change the
> domain name in a config file, and all absolute paths would be updated
> automatically.



Not a clean solution. I am looking at the html source and I see all these
references to a domain name which is not the site I am looking at. Might
not work if you move to non Apache server.


Karim
--
http://www.cheapesthosting.com - Innovative Web Hosting since 1998
Spam and Virus protected email - Online calendars with email notification
Camera phone photos automatic transfers to your photo album (RSS Enabled)
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Narration - Relative Path Reference =?Utf-8?B?THlubg==?= Microsoft Applications 2 01-07-2005 23:00
Relative path in powerful point =?Utf-8?B?Sy4=?= Microsoft Applications 2 11-11-2004 22:55
Can you use a relative path for sub-project links Jim Chatfield Microsoft Applications 1 06-16-2004 17:45
relative path Karlo Petri Microsoft Applications 1 06-16-2004 10:30
Full File Path Griff Microsoft Applications 2 06-16-2004 03:00


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 10:08.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.95000 seconds with 19 queries