Static site hosting with S3
If you go around EC2, and just use the S3 storage facilities, there’s a lot to be gained here. The huge caveat is that you’re not dealing with a fully functional, cgi-enabled, php or other dynamic generated thing. This is just a raw mapping of files to an very simple httpd daemon. Thats it. Nothing else. So all said, your whole site has to be static content, with no funky stuff.
So how might you take something like a blog, and turn that into static content? Interesting you should ask. Below find several links that I’ve hit on my search down this road:
Original post I was just reading in my daily travels which linked me to: Werner Vogels’ blog post and the follow-on post. The method detailed in those two posts is outside of wordpress entirely. I have alot of content already invested in wordpress (as many do), so investigation followed on how to convert wordpress into a static site. If you are intending to archive your wordpress site, and no longer post to it, there is this sort of option. That wasn’t really my intent, however. For a more pragmatic solution, assuming you still want to blog actively, there is this road. I’m going to give that a try over the coming week or so and see if I can get it all working nicely.
One other thought occurred to me too. What if I ran my wordpress install on my machine at home (not visible to the internet), and did all my posting and whatnot on there. Whenever I wanted to push new content, I run it through some combination of the above mentioned tools, and push that to S3. Boom, done. It remains to be seen whether this is reasonable or viable. I mean, you lose one of the most powerful aspects of this… that you can theoretically blog from ANYWHERE. With what I just mentioned, I can pretty much only do it from a machine that I have setup with that “generator” configuration, be it a laptop or home machine or whatever. Not from my phone, not from an ipad, etc. Definitely limited. Not that I ever did that anyway, but after this, I wouldn’t be able to at all.
Another point, since I’ve had inquiries… why would I want to do this? I’ll summarize:
- SECURITY: Blogging, WordPress and other content management systems like it expose you to attack. There are new methods for compromising these sorts of systems being discovered seemingly every week. Even a very cursory glance at WordPress’ releases shows a significant number related to security issues. Pushing the dynamic content to a static site removes the need for that level of security.
- SPEED: Static content is FAST. Anytime you request a page, it just dishes out files. With a “default” WordPress installation, every time you request a page, CPU resources are chewed up on your host site dynamically generating that content with every click. Content being static radically reduces the CPU and memory overhead required.
- EFFICIENCY: Static content can be “pushed to the edge”. A very common tactic for the highest levels of website optimization is to take advantage of Content Delivery Networks (CDN’s) like Amazon Cloudfront and Akamai. When you do this, the files you are serving are replicated to a whole mess of servers around the Internet, and then delivered to the requester from whichever one of those servers is geographically closest (or fastest). Granted, this is typically *not* done for just people’s blogs, and only for sites which are dealing with millions of hits/day, but since it is an integrated service with EC2, its something easy to consider for not much additional cost.
- SOE: Static content is much easier for search engines to crawl and link to. Since the static site is essentially the equivalent of an “archive” for your content, any marketing efforts you make to monetize your content or at least turn up more frequently in search engines has very long term URLs to point to.
More to come…