![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | 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 |
|
| | #2 (permalink) |
| Civilians | "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 |
|
| | #3 (permalink) |
| Civilians | 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 |
|
| | #4 (permalink) |
| Civilians | 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) |
|
| | #5 (permalink) |
| Civilians | 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 |
|
| | #6 (permalink) |
| Civilians | 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 |
|
| | #7 (permalink) |
| Civilians | 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) |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
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 |
![]() | ![]() | ![]() |