Hosting a Website on AWS S3 Bucket

Ann K. Hoang
The Cabin Coder
Published in
2 min readDec 29, 2016

Part 1: Hosting

I already purchased a domain name at Route53 from AWS. I found S3 bucket to be the most cost effective method to host static site.

The first task was to create a new home page with just vanilla HTML. I wanted a form and that usually involve Php and a hosting account, but FormSpree service allows me to just embed the form using this for

<form action=”https://formspree.io/your@email.com"
method=”POST”>
<input type=”text” name=”name”>
<input type=”email” name=”_replyto”>
<input type=”submit” value=”Send”>
</form>

Of course, I still have to jazz it up a bit with stylings. I can have up to 1000 submissions per email each month for the free so this is great.

I use Bootstrap as a framework for HTML, PicMonkey to crop images, Adobe Illustrator to fix the logo and edit some svg images. I am no way an expert in these, but just enough to make tweaks on the layers and logo. Once the development is done, I follow this guide to get me started:

It takes about 10–20 mins to hook everything up.

Part 2: Site Optimization

Now I still need to optimize the site with the following tools:

developers.google.com/speed/pagespeed/insights for pagespeed report and suggestions on optimization

minifycode.com to help minify CSS, JS, and HTML code

optimizilla.com for image optimization

Then, I setup CloudFront CDN with this guide.

setting up CloudFront, Amazon Web Service’s content delivery network to cache the contents for global users.

It is also good practice to register my site with Google’s index here:

AWS now supports gzip compression, so I follow this guide to enable gzip compression for static site on CloudFront.

Your pages will load more quickly, content will download faster, and your CloudFront data transfer charges may be reduced as well. For a typical web page composed of a mix of text, scripts, and images, the overall payload reduction can approach 80%. — AWS, new GZIP compression support

https://aws.amazon.com/blogs/aws/new-gzip-compression-support-for-amazon-cloudfront/

My site is at helloanh.io

--

--

Ann K. Hoang
The Cabin Coder

Senior Software Engineer. Born in Saigon. Raised in the Silicon Valley. Currently in Seattle, WA.