Re: Full versus relative URLs

From: Date: Mon, 16 Feb 2009 09:10:07 +0000
Subject: Re: Full versus relative URLs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-288304@lists.php.net to get a copy of this message
Paul M Foster wrote: > Here's a question related to my last post. When specifying a link in a > HTML file (like to the css or an image file), there are two ways of > doing it. One is to simply include the relative path to the file > (relative to the doc root), like: > > /graphics/my_portrait.gif > > Or you can include the full URL, like: > > http://example.com/graphics/my_portrait.gif > > My casual observation seems to indicate that the former will load > faster than the latter. But has anyone done any benchmarking on it? There is no difference - the browser will resolve relative URLs to absolute URLs before issuing the HTTP GET. /Per -- Per Jessen, Zürich (-0.9°C)

« previous php.general (#288304) next »