When comparing Amazon S3 vs GitHub Pages, the Slant community recommends GitHub Pages for most people. In the question“What are the best website hosting providers?” GitHub Pages is ranked 1st while Amazon S3 is ranked 11th. The most important reason people chose GitHub Pages is:
One of GitHub's features is a very powerful web editor which helps users edit or even create files right from the web browser, once the file is saved it's the same as a commit. Coupled with pages, this tool becomes even more powerful, giving users a free CMS that is easy to use and create.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Free for small sites
The free tier will cover most personal home pages.
Pro Easily scalable
There's no cap in storage or traffic. Cost is based on usage.
Pro Super cheap with a year's worth of free service
S3 storage costs $0.03 per GB and gets cheaper the more is stored, PUT, COPY, POST, or LIST requests are $0.005 per 1,000 requests and GET and all other requests are $0.004 per 10,000 requests. And with some restrictions is available for free for a year.
Pro Fast setup
You can provision a S3 bucket, upload files, setup the DNS, and go live in under 10 minutes.
Pro Fast
S3 is fast even without a CDN.
Pro Easy to setup with CDN
Simple to set up with Amazon's CloudFont CDN.
Pro Supports custom root domains
To set up a custom domain, Amazon Route 53 has to be configured as the DNS provider with the domain registrar, two buckets have to be created and configured with the name the same as the domain - one including, one excluding www. A more in-depth explanation can be found here.
Pro No security risks
There's no server to manage, so no security issues to patch or keep watch.
Pro The ability to create and edit files on the web UI gives GitHub pages the same power as a small CMS
One of GitHub's features is a very powerful web editor which helps users edit or even create files right from the web browser, once the file is saved it's the same as a commit. Coupled with pages, this tool becomes even more powerful, giving users a free CMS that is easy to use and create.
Pro Supports Jekyll
A simple, blog-aware static site generator, Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers some other advanced templating features.
Pro Supports custom domains
A custom domain can be added by creating a CNAME file with the necessary domain in the root of the repository and adding/changing corresponding DNS entries.
Pro Free tier
Static websites can be hosted on GitHub Pages for free as long as the repository is public. Private repositories start at $7/mo.
Pro Allows for all the git features when building your site, too
Cons
Con Credit card needed
Amazon will try to retrieve the money every month after one year trial. If you have no money you will be banned.
Con Setting up automatic public permissions is confusing
By default, S3 sets uploaded files to private. You can configure your S3 bucket to auto-apply public permissions by copying and pasting a template. But the template might be intimidating to some users.
Con Confusing web interface
Amazon S3's web interface is quite confusing, especially for first-time users, but there are many tutorials online that help beginners to set up a static site on S3.
Con No SFTP support
Amazon S3 does not have SFTP support, instead the S3 web interface has to be used.
Con Unable to set cache expiry, must accept GitHub defaults (which are short)
Low cache expires - GitHub sets the cache-control: max-age header to 600 seconds, or ten minutes. Normally, you would set this value to a year so that it stays cached, and then use fingerprinting on your assets. Instead of serving style.css, you would serve something like style-62c887ea7cf54e743ecf3ce6c62a4ed6.css. As it stands now, assets are rarely going to be cached on repeat visits.
This will give a low score on https://developers.google.com/speed/pagespeed/insights with a 'should fix' recommendation around 'Leverage browser caching'.
For a high traffic site this may have implications
![Vetted.ai illustration](/images/ai/vetted-illustration.png)