|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
Full vs. realative urls...
08-09-2007, 01:39 PM
|
Full vs. realative urls...
|
Posts: 158
Name: cbeaudin
Location: Proud to be Canadian
|
Is there any difference between using full or relative urls?
ie.
/images/test.gif
http://www.testdomain.com/images/test.gif
does the full url create more server load?
why use one over the other?
Thanks in advance for replies.
__________________
- cbeaudin
|
|
|
|
08-09-2007, 02:40 PM
|
Re: Full vs. realative urls...
|
Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Both are equals, and relative don't add any overhead to the server.
Trust me, you won't have any performances related trouble by using relative paths.
__________________
Only a biker knows why a dog sticks his head out the window.
|
|
|
|
08-10-2007, 01:11 AM
|
Re: Full vs. realative urls...
|
Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
|
I guess the full URLs add a little more server load, but it's a drop in the bucket. You send down maybe 20 extra bytes in the markup adding your domain, and possibly a path stem, for every image on the page. Which might be 5 or 10 or 20 KB, so the 100 more bytes to fully qualify your domain is a drop in the bucket, but a little more load if you want to get really technical.
It's usually better to use relative paths, because then you can develop your site locally without internet access and still make sure everything works.
|
|
|
|
08-10-2007, 02:09 AM
|
Re: Full vs. realative urls...
|
Posts: 104
Location: http://www.joomladevs.com
|
The full URLs put more server load
|
|
|
|
08-10-2007, 02:21 AM
|
Re: Full vs. realative urls...
|
Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
|
Server load is marginal at best. There's one argument for absolute URLs that most people tend to forget: hijacking. A lot of content thieves will steal code and put it up on their own sites without even editing it. It becomes fairly easy to track duplicate content whores, since the pages are often spidered and in turn the absolute URLs are. I've caught a content jacker on more than one occasion just by doing this.
It's also recommended by people who have inside knowledge of the inner workings of big G to use absolute URLs.
http://www.vanessafoxnude.com/2007/0...-discoverable/
(For those who don't know, Vanessa Fox is a former Google employee who left just recently.)
|
|
|
|
08-10-2007, 07:56 PM
|
Re: Full vs. realative urls...
|
Posts: 38
|
Even if one puts more load than the other, it's not going to be noticeable. Use the one that is easier for you to update in the future.
For example, if you use full URL and later you want to move the whole folder to another folder... you... are... screwed.
|
|
|
|
08-10-2007, 09:40 PM
|
Re: Full vs. realative urls...
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Relative URLs can be easier to maintain, but like Adam mentioned full URLs are a good option when it comes to content theft.
If you have a blog your posts will inevitable get scraped and republished elsewhere. If you use relative URLs in your posts then your content is stolen. If you use absolute URLs then your content is stolen, but you at least get a link back to your site.
|
|
|
|
08-11-2007, 03:30 AM
|
Re: Full vs. realative urls...
|
Posts: 6,521
Name: Dan
Location: Swindon
|
i tend to use a go-between
i make absolute urls but instead of the domain i use a PHP var $core in my case meaning core url this enables me to just change one thing if i ever change the domain or folder on that domain etc. so i get the flexibility of local and the benifits of absolute too! yes, this would put a little bit more load on the PHP its one more thing for it to think about, but i think you would have to have a pretty crap server to notice any differance what so ever.. or just a super sensitive test both of which would have a almost unmessurable differance
hope this helps.
Dan
__________________
Discounted Web Hosting With XDnet! >> Get 25% of hosting~ Promo: Webmaster-talk <<
|
|
|
|
08-11-2007, 02:00 PM
|
Re: Full vs. realative urls...
|
Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
|
Quote:
Originally Posted by ADAM Web Design
Server load is marginal at best.
|
The server load is probably about equal to the extra load on your city's power grid when you turn on a single light bulb. It's not identical, one method puts more load than the other, but it's not enough to worry about. Unless maybe your web server is a 286 with a 2400 baud modem connecting it to the outside world.
Did I just show my age?
Quote:
Originally Posted by ADAM Web Design
There's one argument for absolute URLs that most people tend to forget: hijacking.
|
This is a good enough point that I'll probably rewrite my photo web site to use absolute URLs. Even with the extra bandwidth they create.
|
|
|
|
08-11-2007, 02:18 PM
|
Re: Full vs. realative urls...
|
Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
|
Quote:
Originally Posted by dansgalaxy
i tend to use a go-between
i make absolute urls but instead of the domain i use a PHP var $core in my case meaning core url this enables me to just change one thing if i ever change the domain or folder on that domain etc. so i get the flexibility of local and the benifits of absolute too! yes, this would put a little bit more load on the PHP its one more thing for it to think about, but i think you would have to have a pretty crap server to notice any differance what so ever.. or just a super sensitive test both of which would have a almost unmessurable differance
hope this helps.
Dan
|
I do something similar to this, except that I call my variable Page_Root (in ASP), and I have one for Image_Root as well.
That way, if anything needs to be moved, I...am...not...screwed. I did this because I have a server on my desk and a live server located in Michigan.
|
|
|
|
08-12-2007, 07:27 AM
|
Re: Full vs. realative urls...
|
Posts: 6,521
Name: Dan
Location: Swindon
|
i started doing it with the site im making mainly because im gonna be switching the domains...
anyway i would have thought when thinking about hijacking isnt local domains better because the person has to go in and put the absolut urls to get the images and that to work...
personally when i was learning and had a habit of nickin pages.. to find out how to work etc absolute urls were much eaier to nick and ofen local would put people off i think...
Dan
__________________
Discounted Web Hosting With XDnet! >> Get 25% of hosting~ Promo: Webmaster-talk <<
|
|
|
|
08-14-2007, 02:45 PM
|
Re: Full vs. realative urls...
|
Posts: 5
Name: rafke mertens
|
Exactly the same, except the absolute one makes your html files bigger(more characters).
|
|
|
|
|
« Reply to Full vs. realative urls...
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|