Is there any harm in hosting images off site?

Nick Apromollo picture Nick Apromollo · Jan 4, 2012 · Viewed 9.1k times · Source

Is there any harm hosting images through a website like Imgur then using the code provided to insert it into my website? Versus the traditional way of hosting the images on my server and linking them appropriately.

Answer

Mike Mooney picture Mike Mooney · Jan 4, 2012

The risk is that Imgur goes away and takes you images with it. Or that they have performance problems or outages that you have no control over or visibility into. But ideally some image hosting platform would be more reliable that anything you come up with. Just make sure you keep a copy of you make it relatively easy to switch back to local hosting or another image hosting platform in case you have problems with Imgur.

Along those same lines, it complicates your deployments. You aren't just uploading your one website, you need to upload your site to your servers, upload the images to the other site, and then do whatever configuration is necessary to make sure that your production verison is pointing to the right servers (as opposed to pointing to a QA/Dev server).

Also, if you have any HTTPS on your site, make sure that any images (or JS or CSS or anything else) that you reference from your page is also HTTPS, otherwise your users will get that annoying "this page contains insecure content" error.

Lastly make sure you are operating within the terms and conditions of the hosting company, they may not like you sending them that much traffic and may block you out or throttle you. If you are not sure, ask them.

However, if you do take this approach, it can often have many performance benefits. It reduces the amount of traffic to your site and takes some load off of your web servers. Some browsers may download more simultaneously as well, because some browser versions only open a certain number of concurrent connections to a single domain but will open more connections to other domains (although this may not be the case any more). And of course, again the Imgur servers are probably faster then yours and probably have a content delivery network (CDN) which transmits copies of your images our all over the world so people are getting content from local content cache servers instead of always going back to your server.