Using Amazon S3 as a photobucket
This week free image hosting service Tinypic closed it’s doors without warning to “international images”. A day later it’s back up again after a user revolt, and a number of posts have offered fixes and alternatives. It has though highlighted once again the risks of third-party images hosting services like TinyPic and Photobucket. Time find an alternative solution.
I’ve been using Amazon S3 for hosting static images for my Beantin sites for quite a while. Serving static images from a separate, cookie-less domain has some established performance benefits.
It is though generally a bit awkward to upload images to a Amazon S3 bucket and to make them publicly readable. You have to use a tool such as Cloudberry explorer, or a browser plugin. As good as it is, it’s not exactly click-and-run in the same sense as Tinypic.
Bringing home the Baconfile
So, I did some digging and found a service called Baconfile. It is a click-and-run front end for your Amazon S3 buckets. It couldn’t be simpler to start using (if you already have an S3 account).
Baconfile has been around for over a year, but went very quiet not long after launch. I don’t see this as a risk as your media is stored in your S3 bucket, not theirs. So if they do vanish/close, you’re safe.
One thing Baconfile fails to do is add a cache-control header to your uploaded media. So it’s best to use Cloudberry explorer (or a similar tool) to add one with a sensible value. Not only will this save you a bit of money, it will also speed up page load time for repeat visits.
I also created a new sub-domain (i.t1n.se) especially for the baconfile uploaded images so that I could avoid the cookies stored by the beantin.se domain. That domain is then CNAMEd to i.t1n.se.s3.amazonaws.com.
Now I’ve got something that is easier and better than Tinypic, keeps the media in my control, but unfortunately costs a little bit of money in S3 charges. But, what the hell, the cost for me is tiny.