Forum Moderators: phranque

Message Too Old, No Replies

Which is better: absolute vs relative internal links for performance?

         

slobizman

2:53 pm on Jun 5, 2011 (gmt 0)

10+ Year Member



In my Wordpress sites I have been coding my internal page links as fully qualified links. I'm performance optimizing my site on my dedicated server and my hosting company, who seems pretty smart, offered this suggestion:

One other suggestion is to verify that code is using local request for content and not fully qualified links which will create additional apache connections and increase load time.


Another support tech there had told me the same thing a year ago, but when I asked on wordpress,org someone told me no way, makes no difference.

What do the experts here have to say?

pageoneresults

3:12 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Previous topic on this...

Relative vs Absolute Links - Which is Slower?
Feb 7, 2010 - [WebmasterWorld.com...]

I use absolute on hrefs.

http://<%=application("wwwserver")%>/

slobizman

4:05 pm on Jun 5, 2011 (gmt 0)

10+ Year Member



Thanks for pointing that out. I just went to the thread to post there, but the replying has been turned off for it, guess it's too old a thread.

I didn't see anything there that specifically addressed the "additional apache connections" issue. Anyone know?

slobizman

4:19 pm on Jun 5, 2011 (gmt 0)

10+ Year Member



I did some further web searching and there are references that using absolute URL's do open more connections to the server when called.

Here's one conversation:
[webhostingtalk.com...]

pageoneresults

4:24 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I didn't see anything there that specifically addressed the "additional apache connections" issue.


You know, I've never really looked into that. If I were to provide an answer based on common sense, I might say that there is no difference. In fact, I might even go as far as saying that the absolute path is milliseconds quicker.

If Google told you to use Absolute URIs where possible, would you? Okay then... ;)

Where possible, use absolute rather than relative links. (For instance, when linking to another page in your site, link to www.example.com/mypage.html rather than simply mypage.html).


URLs not followed errors
Mar 20, 2011 - [Google.com...]

pageoneresults

4:34 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I did some further web searching...


So did I. There appears to be some differences in how this is handled between HTTP 1.0 and HTTP 1.1.

Absolute vs Relative Paths and Server Load
[Forums.DevShed.com...]

lucy24

8:46 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There appears to be some differences in how this is handled between HTTP 1.0 and HTTP 1.1.

Uh-oh. Wild generalization (or do I mean gross oversimplification?): 1.1 = human, 1.0 = robot. Any place that you go to look up your actual connection speed for some specific link will involve a robot.

Now that people are no longer using 1400baud dialup modems (where you can simply sit there with a stopwatch ;)), is there any way to test for human connection speed?

incrediBILL

9:07 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Absolute URLs are more annoying to scrapers, all the reason I need :)

g1smd

9:15 pm on Jun 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's a major difference in using a local server filepath (which is internally requested) and a URL with protocol and domain name (creates a HTTP connection to fetch the file) when using a PHP INCLUDE.

I've not seen anything about such a thing when creating links within site navigation, or to images, and so on.

phranque

11:50 am on Jun 6, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if someone clicks a link to one of your internal pages, the browser will open a connection to your server and request the linked resource.
it doesn't matter if you coded that url as relative or absolute, the browser will request a fully qualified url.
try Live HTTP Headers and you'll see exactly what is requested.

while persistent connections and pipelined requests are part of the HTTP 1.1 protocol, that has no bearing on how a given request is made for a relative url vs an absolute url.