Absolute Or Relative Image Linking?
I was wondering if anyone could explain to me the pros and cons of "absolute" vs "relative" image source linking?
For example...
Absolute image linking:
VS
Relative image linking:
I understand that the relative approach makes life easier if the domain name ever gets changed to something else.
What mainly concerns me, is performance, security, and compatibility.
In terms of performance, are there any issues surrounding load time or dns lookup?
What are your experiences?
Thank you very much.
Renegade posted this at 09:50 — 7th February 2005.
He has: 3,022 posts
Joined: Oct 2002
Yes, there is a difference in load time. When the images are linked relatively, they load A LOT faster. Usually a good idea to link relatively.
NewTechGuy posted this at 17:03 — 7th February 2005.
He has: 57 posts
Joined: Dec 2004
I've also heard that if you link your images using absolute links that OTHER people can use your links on their website thereby pirating your bandwidth. This may result in overage charges from your server company or your internet provider. I'm not sure how widespread this problem is, but it's something I read about and thought I would share it with you.
CptAwesome posted this at 17:17 — 7th February 2005.
He has: 370 posts
Joined: Dec 2004
Well, NTG is not correct in the concept that people can only steal your images if you link them absolute. Anyone can steal anyone's images unless you configure you .htaccess in a way to deny from all except when you're the referrer.
If you have a multileveled website (lots of folders and subfolders) and only one domain name, then, it's likely easier to set them absolute. The same idea goes if you have a lot of dynamic content, you might end up with a lot of Xs if you're not careful with your relativity.
I don't know if it's true that relative ones load faster or not. But if you have multiple domains, or you ever plan on changing your domain. It's also a lot shorter, and looks cleaner. Having the domain name in there is really redundant.
In case you were wondering, TWF uses relative
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.