You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sivakatirswami <ka...@hindu.org> on 2002/03/26 03:07:33 UTC

relative vs absolute URL's / CPU processing overhead

I am trying to set a development policy that will impact coding of future
web pages, both those done by hand and those done under automation by
software that we write to build pages from templates, file and from within
data bases. I suspect this  has been asked and answered but no amount of
searching on the web got me anywhere.

 The issue is whether use of absolute URLs to reference images and other
*.html documents  in the same public_html directory increases CPU overhead
or not...  in terms of time taken for Apache to serve images for that page
or serve/reference documents on the same site from links on the page. I find
two schools of thought, one says absolute URLs will require addition
overhead on the CPU in terms of DNS required to resolved every absolute URL
from "the top down," that is not required for relative URLs. The other
school of thought is telling me that no, it doesn't natter, even the
relative URL's require a DNS action before the image can be sent out along
with the .html document and portability is the only issue not CPU time. I
myself do not know which is true.

Assume, for example, some 25 images on a page all quite small mostly
navigation buttons and few larger JPGs in the content itself... assume a
*.html page  three directory levels deep... if we use

<img src="http://www.mywebsite/images/somegif.gif" > vs
<img src="../../../images/somegif.gif">

do 25 instances of the former slow down serving the page vs 25 instances of
the latter?

Of course, the issue of portability, being able to view the site locally
under development on the LAN without opening connections to the ISP host
outside the LAN where the domain actually lives etc. obviously puts relative
URL's in the lead for preferred usage... but the overhead required to "go to
the trouble" to figure out what directory level a document will be on when
it is finally complete and posted to the site and the ease of simply using
an absolute URL which will work regardless of the page's directory level...
begs for use of absolute URL's, especially by those who are doing coding by
hand and get their locations confused and would rather just use an absolute
URL instead of debugging their image references later if they have the
levels wrong where "../../image/some.gif"  should really be
"../../../image/some.gif"

And besides the CPU overhead question I would like any input from more
experienced web masters on this issue... if you have "strong feelings" about
this subject then I would like to know what they are what led you to your
conclusions.
Thanks!

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
katir@hindu.org 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org

Read The Master Course Lesson of the Day at
http://www.gurudeva.org/lesson.shtml


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by Sivakatirswami <ka...@hindu.org>.
on 3/25/02 5:30 PM, James Harr at james@grickle.org wrote:

> When a web browser requests a url, it does shoot the DNS server for a
> domain. Netscape 3.x-4.x, however, has its own built in dns server, which
> is an other story..
> 
> The ISP keeps a cache of these names (if they don't, they should be). When
> you request for an IP of foobar.com, and it has 5 different round robin
> addy's, the cache servers keep these in record too. So they round robin
> each
> 
> Let me knwo if this is what you wanted,
> Later,
> jh
Thanks, James, this is very instructive but I think you may be a bit over my
head...

> the question remains, is there a speed
>> difference between a relative URL vs an absolute one? Albeit perhaps
>> trivial in certain configurations...but not trivial if there is
>> congestion on packet transfers to the IP/server doing the DNS...?
 
scenario: client web browser in San Diego find ones of our pages on
google...www.hinduismtoday.com, then clicks on that link...  then a DNS
server, closest one, say at ISP: electricity.com (the IPS for the client
logging onto the net) does the resolution and the IP for our domain is sent
back to the client browser, that being 64.75.176.66 for a virtual domain
hosted at ISP-Web Host: mahiai.aloha.net in Honolulu. The client browser
then opens a socket to that IP and sends an HTTP GET request for foo.html...
now, if that document contains 20 img refs that are absolute

<img src= "http://www.hinduismtoday.com/images/header.gif"

then will the web browser "shoot" for DNS 20 times to it's own ISP:
electricity.com for each image?

If I hear you right you are saying, no... the ISP-web host that is serving
the page foo.html should have a cache of DNS? and also that possibly the web
client itself (more recent browsers) is caching the DNS? i.e the web client
is NOT shooting for DNS to any DNS server after the first one is resolved
and therefore speed issues for absolute or relative links for images in an
*html pages are insignificant/trivial as you said initially.. .Did I get
that right? 
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
katir@hindu.org 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org

Read The Master Course Lesson of the Day at
http://www.gurudeva.org/lesson.shtml


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by James Harr <ja...@grickle.org>.
Sivakatirswami said:
> on 3/25/02 4:28 PM, James Harr at james@grickle.org wrote:
>
>> Hi Sivakatirswami,
>>
>> It shouldn't make too much of an impact, however I do believe the ..
>> is handled by the web browser (most web browsers).
> Thanks James...so the web browser is taking <img
> src="../../images/some.gif"> and uses that to send out another HTTP GET
> request... OK, but the time-to-serve issue still pertains, but not in
> terms of CPU time on the server running Apache.  The question then is:
>
> Does a web browser have to "hit on" a DNS server to resolve every
> absolute URL (even to the same domain as the page itself) which are
> separate upstream socket request(s) (one for each image with an
> absolute URL on the page) , to the DNS server the web-client is using,
> in addition to the requests through the socket processing the GET
> requests... i.e. if relative URL's are used, then, is there is only one
> DNS request, the IP of the domain cached locally with all subsequent
> GETs defaulting to that IP? If the latter is the case then relative
> should be faster. That being a web browser software application issue
> and not an apache one... the question remains, is there a speed
> difference between a relative URL vs an absolute one? Albeit perhaps
> trivial in certain configurations...but not trivial if there is
> congestion on packet transfers to the IP/server doing the DNS...?

When a web browser requests a url, it does shoot the DNS server for a
domain. Netscape 3.x-4.x, however, has its own built in dns server, which
is an other story..

The ISP keeps a cache of these names (if they don't, they should be). When
you request for an IP of foobar.com, and it has 5 different round robin
addy's, the cache servers keep these in record too. So they round robin
each.

Note: If there were no cache DNS servers, the root servers for the internet
would be overloaded, and the internet would be about 25% dns requests,
rather than the 0.5% that it is (those are just numbers I pulled out of
my... ya know. But they are a good starting point).

So, yes, round robin DNS does work for load balancing.

As far as the webserver & dns load. If your servers get anywhere near
overloaded by some trivial regexp functions, you need more load balancing &
servers. I suggest taking a look at www.linuxvirtualserver.org. They have a
lot of that figured out, it's rather interesting too. I also suggest pvfs
(parallel virtual file system). It's like OpenAFS, Coda, and Inter-Mezzo,
but has a simpler, and better design.

Let me knwo if this is what you wanted,
Later,
jh

>> later,
>> jh
>>
>> Sivakatirswami said:
>>> I am trying to set a development policy that will impact coding of
>>> future web pages, both those done by hand and those done under
>>> automation by software that we write to build pages from templates,
>>> file and from within data bases. I suspect this  has been asked and
>>> answered but no amount of searching on the web got me anywhere.
>>>
>>> The issue is whether use of absolute URLs to reference images and
>>> other *.html documents  in the same public_html directory increases
>>> CPU overhead or not...  in terms of time taken for Apache to serve
>>> images for that page or serve/reference documents on the same site
>>> from links
>
> Om shanti,
> Hinduism Today
>
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir@hindu.org
> www.HinduismToday.com, www.HimalayanAcademy.com,
> www.Gurudeva.org, www.hindu.org
>
> Read The Master Course Lesson of the Day at
> http://www.gurudeva.org/lesson.shtml
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project. See <URL:http://httpd.apache.org/userslist.html> for more
> info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by Sivakatirswami <ka...@hindu.org>.
on 3/25/02 4:28 PM, James Harr at james@grickle.org wrote:

> Hi Sivakatirswami,
> 
> It shouldn't make too much of an impact, however I do believe the .. is
> handled by the web browser (most web browsers).
Thanks James...so the web browser is taking <img
src="../../images/some.gif"> and uses that to send out another HTTP GET
request... OK, but the time-to-serve issue still pertains, but not in terms
of CPU time on the server running Apache.  The question then is:

Does a web browser have to "hit on" a DNS server to resolve every absolute
URL (even to the same domain as the page itself) which are separate
upstream socket request(s) (one for each image with an absolute URL on the
page) , to the DNS server the web-client is using, in addition to the
requests through the socket processing the GET requests... i.e. if relative
URL's are used, then, is there is only one DNS request, the IP of the domain
cached locally with all subsequent GETs defaulting to that IP? If the latter
is the case then relative should be faster. That being a web browser
software application issue and not an apache one... the question remains, is
there a speed difference between a relative URL vs an absolute one? Albeit
perhaps trivial in certain configurations...but not trivial if there is
congestion on packet transfers to the IP/server doing the DNS...?
 
> later,
> jh
> 
> Sivakatirswami said:
>> I am trying to set a development policy that will impact coding of
>> future web pages, both those done by hand and those done under
>> automation by software that we write to build pages from templates,
>> file and from within data bases. I suspect this  has been asked and
>> answered but no amount of searching on the web got me anywhere.
>> 
>> The issue is whether use of absolute URLs to reference images and other
>> *.html documents  in the same public_html directory increases CPU
>> overhead or not...  in terms of time taken for Apache to serve images
>> for that page or serve/reference documents on the same site from links

Om shanti,
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
katir@hindu.org 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org

Read The Master Course Lesson of the Day at
http://www.gurudeva.org/lesson.shtml


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by James Harr <ja...@grickle.org>.
That's what I thought, but I didn't know if there were any broken web
browsers out there.

Joshua Slive said:
>
> On Mon, 25 Mar 2002, James Harr wrote:
>
>> Hi Sivakatirswami,
>>
>> It shouldn't make too much of an impact, however I do believe the ..
>> is handled by the web browser (most web browsers).
>>
>
> Make that ALL browsers.  The server sees only absolute URLs.  The
> browser is completely responsible for doing all the necessary
> caculations.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project. See <URL:http://httpd.apache.org/userslist.html> for more
> info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 25 Mar 2002, James Harr wrote:

> Hi Sivakatirswami,
>
> It shouldn't make too much of an impact, however I do believe the .. is
> handled by the web browser (most web browsers).
>

Make that ALL browsers.  The server sees only absolute URLs.  The browser
is completely responsible for doing all the necessary caculations.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by James Harr <ja...@grickle.org>.
Hi Sivakatirswami,

It shouldn't make too much of an impact, however I do believe the .. is
handled by the web browser (most web browsers).

later,
jh

Sivakatirswami said:
> I am trying to set a development policy that will impact coding of
> future web pages, both those done by hand and those done under
> automation by software that we write to build pages from templates,
> file and from within data bases. I suspect this  has been asked and
> answered but no amount of searching on the web got me anywhere.
>
> The issue is whether use of absolute URLs to reference images and other
> *.html documents  in the same public_html directory increases CPU
> overhead or not...  in terms of time taken for Apache to serve images
> for that page or serve/reference documents on the same site from links
> on the page. I find two schools of thought, one says absolute URLs will
> require addition overhead on the CPU in terms of DNS required to
> resolved every absolute URL from "the top down," that is not required
> for relative URLs. The other school of thought is telling me that no,
> it doesn't natter, even the relative URL's require a DNS action before
> the image can be sent out along with the .html document and portability
> is the only issue not CPU time. I myself do not know which is true.
>
> Assume, for example, some 25 images on a page all quite small mostly
> navigation buttons and few larger JPGs in the content itself... assume
> a *.html page  three directory levels deep... if we use
>
> <img src="http://www.mywebsite/images/somegif.gif" > vs
> <img src="../../../images/somegif.gif">
>
> do 25 instances of the former slow down serving the page vs 25
> instances of the latter?
>
> Of course, the issue of portability, being able to view the site
> locally under development on the LAN without opening connections to the
> ISP host outside the LAN where the domain actually lives etc. obviously
> puts relative URL's in the lead for preferred usage... but the overhead
> required to "go to the trouble" to figure out what directory level a
> document will be on when it is finally complete and posted to the site
> and the ease of simply using an absolute URL which will work regardless
> of the page's directory level... begs for use of absolute URL's,
> especially by those who are doing coding by hand and get their
> locations confused and would rather just use an absolute URL instead of
> debugging their image references later if they have the levels wrong
> where "../../image/some.gif"  should really be
> "../../../image/some.gif"
>
> And besides the CPU overhead question I would like any input from more
> experienced web masters on this issue... if you have "strong feelings"
> about this subject then I would like to know what they are what led you
> to your conclusions.
> Thanks!
>
> Hinduism Today
>
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir@hindu.org
> www.HinduismToday.com, www.HimalayanAcademy.com,
> www.Gurudeva.org, www.hindu.org
>
> Read The Master Course Lesson of the Day at
> http://www.gurudeva.org/lesson.shtml
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project. See <URL:http://httpd.apache.org/userslist.html> for more
> info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: relative vs absolute URL's / CPU processing overhead

Posted by Bill -Sx- Jones <sn...@mac.com>.
On 3/25/02 9:07 PM, "Sivakatirswami" <ka...@hindu.org> wrote:

> I am trying to set a development policy that will impact coding ...

Write it in pencil as it will likely change once you figure out what you
want to do...


> The issue is whether use of absolute URLs to reference images and other
> *.html documents  in the same public_html directory increases CPU overhead
> or not...  in terms of time taken for Apache to serve images for that page
> or serve/reference documents on the same site from links on the page.

There is no measurable impact on the server with regard to Absolute or
Relative URLs - but there could be an issue where your server slows down if
you are using mod_spel and there are thousands of similar filenames in the
directory in question.

 
> *.html page  three directory levels deep... if we use
> 
> <img src="http://www.mywebsite/images/somegif.gif" > vs
> <img src="../../../images/somegif.gif">
> 
> do 25 instances of the former slow down serving the page vs 25 instances of
> the latter?

Huh?  What's wrong with just a standard:

<img src="/images/somegif.gif">

???


> Of course, the issue of portability, being able to view the site locally
> under development on the LAN without opening connections to the ISP host
> outside the LAN where the domain actually lives etc. obviously puts relative
> URL's in the lead for preferred usage... but the overhead required to "go to
> the trouble" to figure out what directory level a document will be on when

???  Is this a first site design for you or your team?


> levels wrong where "../../image/some.gif"  should really be
> "../../../image/some.gif"

Sounds like you are not mirroring your development...  I host
http://insecurity.org/ on my laptop - then just mirror updates.

If you have multiple developers then I would suggest an internal development
host then publish the changes to the production host.


> And besides the CPU overhead question I would like any input from more
> experienced web masters on this issue... if you have "strong feelings" about
> this subject then I would like to know what they are what led you to your
> conclusions.

Well, if you must know ...

1)  get a Mac running MacOS X
2)  get BBEdit
3)  Sleep better knowing you're now 100% more effective.


BTW - CPU time will not matter after you consider where your clients are and
what technology they are using to access your site.  My point being:  Make
it easier for your clients - they will like you more if you think of them.

Cheers;
-Sx-  :]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org