When it comes to building sites, the nature of the web makes it incredibly easy to pull together resources in order to execute on an idea. It’s far easier than it should be to reference material from other sources to piece together your design.
For example, assume that there’s a set of images on a third-party site that you’d like to include in your own. It’s easy to insert image tags (or CSS properties) that reference the resource by its URL.
Yes, it’s convenient, but it’s also dangerous. Here are three reasons why…
Borrowing Bandwidth
Whenever someone lands on your web page, their computer initiates a request to the machine on which your site is hosted. The web browser on your visitor’s will read all of the information returned to it from said server and then begin rendering the information.
But prior to rendering, the browser has to look up all the necessary resources – images, videos, etc – that are needed to display. If you’re including resources from a third-party site, you’re telling the browser to not only pull resources from your machine, but the third-party machine, too.
Ultimately, this results in a third-party server having to use their bandwidth (which they are paying for) in order to transfer the data back to your visitor’s computer
As a rule of thumb, never link to the third-party resources. Host them on your own machine.
It’s Private Property
Whenever you’re requesting resources from another site within the context of your own site, there’s a significant chance that you’re breaking a copyright. The little copyright statements that people place in the footer of their pages is not just lip service – it’s a valid form of copyright.
No, this isn’t always the case but it’s best to play it safe. Server logs do show information as to who requests data (and when it occurred) so leaching from people that are sensitive to this – and they have to right to be so – may end up in a much more complex situation.
If someone has an asset that you’d like to use in your project, simply ask. Sure, they might turn you down, but they aren’t going to drag you into court for that.
Security Concerns
Finally, when referencing information from a third-party site in your code leaves you open to some serious security concerns.
If you’re linking to something such as an image file or a video clip, then you are at the mercy of that website. If they detect that you’re pulling information from them, it’s a simple matter of them changing the content of the file in order to take advantage of your website.
Your background image becomes a tiled image of something weird or that music video ends up being replaced with something that’s NSFW.
Again, always host resources for your sites and project on your server.
These are three big issues that hopefully bring awareness as to why you should host your resources on your server, though there are more. If you’ve got additional suggestions, share them in the comments!
Shawn says
An excellent example from times past.
http://techcrunch.com/2007/03/27/john-mccains-myspace-page-hacked/
Tom says
Exactly