Is there any harm in hosting images off site? [closed]
Asked Answered
B

4

25

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.

Baeza answered 4/1, 2012 at 19:47 Comment(2)
I don't get why this was closed, seems like a fairly reasonable questionBritneybritni
Agree with Mike Mooney on this one. I got here looking for some insight on doing this. Not everyone who uses Stack has touched on every possible web development scenario.Aflcio
B
23

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.

Britneybritni answered 4/1, 2012 at 19:57 Comment(0)
P
13

Read the terms of service for the site you plan to use. From your example of Imgur, their ToS states:

Also, don't use Imgur to host image libraries you link to from elsewhere, content for your website, advertising, avatars, or anything else that turns us into your content delivery network. If you do – and we will be the judge – or if you do anything illegal, in addition to any other legal rights we may have, we will ban you along with the site you're hotlinking from, delete all your images, report you to the authorities if necessary, and prevent you from viewing any images hosted on Imgur.com. We mean it.

http://imgur.com/tos (20.04.2016)

I know that Flickr's ToS says something similar (must link to Flickr, don't abuse it, etc.).

EDIT: You are describing a CDN (http://en.wikipedia.org/wiki/Content_delivery_network) which, assuming you use a reputable provider, is a perfectly acceptable way of reducing your web page's load time.

Panpipe answered 4/1, 2012 at 19:56 Comment(1)
Ack! That TOS sucks. Though I guess if you use the link they provide the majority of the time instead of always hotlinking directly, it may be okay.Confabulate
G
10

There are advantages to off-site hosting like:

  1. you don't pay the bandwidth bill
  2. CDNs (content delivery networks) are usually optimized for speed/caching
  3. The other domain doesn't get sent any of the cookies from your current domain (making request size smaller)
  4. Off-site hosts may have a better infrastructure than your own servers (redundancy, load balancing...etc)

Disadvantages:

  1. You don't own the servers that host the image - they could shutdown, or go out of business, or delete your files without letting you know.
  2. If security is a concern, you have less control over access or a potential security breach.
  3. Off-site hosts are generally optimized for caching, this means that if you replace an image on the off-site host, anyone who has visited the site may get the previous version if they still have it cached, so plan accordingly (you can't make your users press CTRL+F5).
Gabbro answered 4/1, 2012 at 20:1 Comment(1)
Another disadvantage is that sites like Imgur scramble file names using random text characters, which makes it hard to keep track of which image goes where.Confabulate
D
-3

Why would you ever want to do this, I feel like its just clunky. For one it will most likely slow down load times, not significantly but at least enough that someone may notice. Also if your plan is to host them on a free site like imageshack or something like that then you have to worry about bandwidth issues. I would get in the habit of simply not doing this.

Datcha answered 4/1, 2012 at 19:56 Comment(2)
I'm not following the reasoning here. Off-site hosting on content delivery services is primarily for the purpose of improving load times. It allows browsers to simultaneously request more content (sometimes browsers won't make too many requests to the same server), takes advantage of more of the end-user's bandwidth (the last mile these days often has lots of unused resources), and offloads static resource content from the host's bandwidth (requests made to the content delivery host, not the owner's host).Ulphiah
It also is very useful for slow servers so that load times are better because the biggest chunk is given by much faster and better serversBoehmenism

© 2022 - 2024 — McMap. All rights reserved.