0
Abstract
I'm rebuilding my website and this time around, I have decided to go with a static website generator (jekyll, sculpin.io, etc). Partially as an excercise, I want this site to be hosted on a globally balanced hosting for speed. (So US viewers should get the site from the US server.)
So, my goal is to create the fastest site humanly possible. Because I hopefully can.
As a bonus task, if possible, I'd like to place a redirector that directs certain language users to the English, German, etc version of the site.
The question is, how do I do this? Here's what I've tried:
Using a CDN
I could get a random static webhost and put a CDN in front of the whole page. While this would work reasonably well, CDN's drop little used resources from the cache and need to re-fetch them when needed, which increases the load time.
Amazon AWS static website hosting
Using Amazon S3 buckets, one can build a static hosting. The problem is that the bucket's name must be EXACTLY the same as the website's name and bucket names are global, so I can't create multiple instances of the bucket and serve the site directly.
Amazon Route53/EC2
While running my own operating system is less than optimal (too much work, high costs), it is an option. Especially since Puppet makes automation easy.
This setup would require an EC2 instance in each region, one Elastic Load Balancer configured in front of it and Route53 to route traffic to geographically local ELB's.
Build it yourself
Rending VPS or root servers in each region, I can run my own OS and install nginx. In any other respect, this would work much like the AWS setup.
Summary
None of these fulfill my needs for a static website hosting. How would approach this problem? What are the hidden issues on this? Any services that I need to look at?
Down-voter, do you have a comment? – Michael - sqlbot – 2015-11-04T01:06:41.970
This actually sounds quite reasonable with a few modifications: 1. instead of doing a proxy, the EC2 instances could just download the whole page (remember, it's static). 2. I am unsure if the language redirection would work with a CDN in front of the page, so that may have to be bypassed, or the CDN left out of the game completely.
I'm more on the side of building a system that's reasonably fast and good, while being reasonably priced (~50-100 USD a month). It's a tech demo, after all. – Janos Pasztor – 2015-11-04T15:45:19.753
1
I completely forgot about your content localization requirement. If enabled, CloudFront inserts a header,
– Michael - sqlbot – 2015-11-04T17:58:47.860CloudFront-Viewer-Country
, that you could use for localization. If the value of the header is, say,US
, it will cache that response against that specific value, i.e., only for users who also resolve asUS
-- but will send a new request to the origin if any not previously seen value is there. See my test site at https://cloudfront.sqlbot.net. (View the page source to see the request headers sent by CloudFront). You could use that to change the content or to redirect to/us/
.