|
Home > Archive > Apache Server configuration support > August 2006 > Best practice for img src path?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Best practice for img src path?
|
|
|
| Will referencing an image like this:
<img src="http://www.example.com/images/image.gif">
incur any more latency than this:
<img src="/images/image.gif">
I was told that the fully qualified path (first example) is better if I am
hosting multiple domains on the same server (with content separated into
subdirectories) using htaccess rewrites to point requests to their respective
subdirectories.
Will Apache grab the image differently without the fully qualified path (second
example)?
There are many small images on this site...
Thanks in advance.
| |
|
| "deko" <deko@nospam.com> schreef in bericht
news:cZydnY-Zr_cQL23ZnZ2dnUVZ_sudnZ2d@comcast.com...
> Will referencing an image like this:
>
> <img src="http://www.example.com/images/image.gif">
>
> incur any more latency than this:
>
> <img src="/images/image.gif">
>
> I was told that the fully qualified path (first example) is better if I am
> hosting multiple domains on the same server (with content separated into
> subdirectories) using htaccess rewrites to point requests to their
respective
> subdirectories.
>
> Will Apache grab the image differently without the fully qualified path
(second
> example)?
>
> There are many small images on this site...
A browser converts a relative link to a link with full path, just check
your access_log: the url of any request starts at the root of the site.
If the hostname is missing the browser will make a new request to the same
host the current page was retrieved.
In other words, because the requests made by the browser are identical,
apache cannot distinct between these links
<img src="http://www.example.com/images/image.gif">
<img src="/images/image.gif">
<img src="../../images/image.gif">
hansh
| |
|
| >> Will referencing an image like this:
[vbcol=seagreen]
> A browser converts a relative link to a link with full path, just check
> your access_log: the url of any request starts at the root of the site.
I see. So it makes absolutely no difference. I think I will stick with the
fully qualified path to avoid ambiguity.
> If the hostname is missing the browser will make a new request to the same
> host the current page was retrieved.
>
> In other words, because the requests made by the browser are identical,
> apache cannot distinct between these links
> <img src="http://www.example.com/images/image.gif">
> <img src="/images/image.gif">
> <img src="../../images/image.gif">
10-4
Thanks for the tip
|
|
|
|
|