Jekyll blog on Amazon S3 and CloudFront
vvv.tobiassjosten.net
vvv.tobiassjosten.net
(Sorry for the shameless self-promotion; it's an exciting day for us!)
But that's pretty cool ...
My initial Heroku config evolved too. I am now serving my pages through an Nginx server, installed with a custom buildpack [2] that I forked and modified a little to suit my directory structure (I could also make it compile the site on deploy but was too lazy for that).
I am also putting CloudFlare in front of it. Basically an article can end up on Hacker News, Reddit, Slashdot and the traffic combined will probably not make it even blink, while the hosting costs are zero.
Whenever I see people bitch about Wordpress woes, setups of clusters, security issues, or about caching/editing/versioning/archiving plugins or about costly add-ons and restrictions, it makes me chuckle a little - but then again, this setup is not for mere mortals or optimal for large content websites - for technical people however is a freaking nirvana.
Full disclosure: I am an engineer at AppFog.
Wordpress is only useful if you want to publish in multiple categories with articles created by other (non-technical) people, need designs made by other designers - basically for a publishing factory or for people that don't want the hassle of learning to use Git, Jekyll and a good text editor.
However Jekyll/Git/Heroku is simplicity in its purest form, especially for developers and with simplicity comes a lot of power ... like I've had 2 blogs before this one and I lost the content on both out of ignorance, by stopping payments to my hosting provider, then later regretted it.
My content right now is on my laptop, mirrored by both GitHub and Heroku and you get for free the history of all changes, while the articles themselves get edited in the most powerful text-editor ever created (Emacs). Scaling comes for free. Costs are zero. The domain is mine. I can publish however many ads I want (coughwordpress.comcought). It wouldn't lock me out if I were under 18 (coughblogger.comcough).
To me that's just awesome. On the other hand it's just a stupid blog. Which it should be. Which is why less is more.
[1]: http://bugsplat.info/2011-12-14-yet-another-not-very-static-... [2]: https://github.com/peterkeen/bugsplat.rb
Personally I prefer [1] using a subdomain over the bare domain. If your registrar doesn't support www redirection you could always use WWWizer [2].
[1] http://vvv.tobiassjosten.net/internet/using-www-for-your-dom... [2] http://wwwizer.com/
* my website, hosted on GitHub: http://crystae.net/
* toy cellular automata project, hosted on GitHub: http://crystae.net/automatra
Author's argument about Github Pages not allowing custom Jekyll plugins is true, but you can always build the site locally with whatever plugins you like and deploy the built copy (see Octopress[1] for a popular example of this).
For new blogs I could definitely consider GitHub Pages. In fact I use it for one I started just a month ago.
not trying to diss the post, which was very interesting, just suspect of the pingdom stats. unless using static pages alone is sufficient to get you into the fastest 1% these days? i guess it's possible. maybe they're hosted nearby... [update: the traceroutes differ in where they enter the usa]
You can manually create a new page "index.html" in the corresponding subdirectory for your redirect. If you want /post/oops-i-made-a-tpyo to redirect to your updated oops-i-made-a-typo link, you would create /post/oops-i-made-a-tpyo/index.html and make an HTML redirect:
<meta http-equiv="refresh" content="0;url=/post/oops-i-made-a-typo/" />
You can see this at work on my blog [1] and the code for the redirects I made [2] when migrating from Tumblr.[2] https://github.com/frankjwu/frankjwu.github.com/tree/master/...
1. I don't see why you would bother with Amazon's CloudFront. CloudFlare is as easy to use and free, unlike CloudFront; it's worked well for me. 2. s3cmd is a good utility, but there are occasional cornercases. On my Debian testing system, use of '--guess-mime-type --mime-type=text/html' may have... unfortunate consequences for quite a few files you would not expect, such as CSS or image files.
"You're over the rate limit. Serve this file from your own servers. Contact support@github.com if you have questions."
https://raw.github.com/git/git/master/Documentation/RelNotes...
Pingdom is kind of nifty for its comparisons. I got the author's site to be only in the top 97% by running the benchmark again. My own site varies from being in the top 90% to 96% (I did get a 99% once), the only real "optimization" I do is reading cached pages from "disk" (EBS is notoriously pretty slow). I could probably shave off an average 100ms with some really simple tricks. Under heavy load I'm certain I'd fall over on such a puny machine that isn't even using nginx+memcached.
In a free Heroku instance you have a lot of juice actually, especially for an Nginx server, the only problem being that the instance will go in idle mode after an hour of inactivity and so unlucky visitors can get some latency on the first request, although it's not that awful.
On the other hand CloudFlare is a pretty good proxy that works like a CDN, so with the right caching headers set, CloudFlare will serve many requests from its own cache.
If you strive for geek cred, you can get
> Your website is faster than 100% of all tested websites
The trick is to 1. have a static website, obviously, and everything inlined (so basically a single index.html); 2. run the test twice — dns responses should cache during the first one; 3. host your website in Amsterdam which is where they have (at least one of) their testers:
> Tested from Amsterdam, Netherlands on October 16 at 19:04:21
Oh, and don't use SSL.
As for resources spent, my own blog has had just over 10k pageviews since Saturday when I launched on S3/CF and for that I'm paying $0.07 (S3) + $0.12 (CF) = a whooping $0.19! Including a lot of writing files back and forth to get everything up and running.
[1] http://aws.amazon.com/s3/pricing/ [2] http://aws.amazon.com/cloudfront/pricing/
Aside from being unable to figure out a anti-hotlink bucket policy, S3 is great and basically free in most for most blogs.
The blog: http://pygm.us/q6Nv3lja.
Of course it's still literally infinitely larger than my current income :P. (I'm abusing the word "infinitely" horribly, but so be it.)
I think I'm almost definitely going to go the S3 route when I get around to redoing my site and starting a blog. (One day...)
The key downside to hosting directly on S3 is it only does static pages. So it'll be manual HTML or a static-html-generating-tool like Octopress - none of this fancy dynamic content.
If you're happy with this constraint, hosting on S3 works pretty well for me.
Also, almost anything would be an improvement over my current setup which is using PHP on Apache to do what a static compiler would do much better. All I really want is a way to factor my website and reduce code duplication.
Good to hear it's working well for you.
But I disagree with one thing — the "git push → deploy dance" is a pro for Jekyll! ;)
5 MB of upload later on a clogged wifi link, it was up live. Admittedly, that's because the generation was done on his laptop and pushed up, not done on the server side. But 5mb and a ton of rendering time is going to suck if you're ever changing things for formatting, or edit anything.