When comparing GitHub Pages vs Surge, 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 Surge is ranked 15th. 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.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
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
Pro Free Tier
Unlimited projects, deployments, and collaborators in free tier which also includes basic SSL. Pro options for those who need it cost $13/month (or all you can eat top tier at $30/mo) which gives you auto-provisioning SSL certificates on custom domains.
Pro Automatic Clean URLS
/page resolves /page.html
Pro Custom 404.html files
Catch-all 200.html files.
Pro Six Keystrokes to publish site
Type surge and hit enter in your project directory to deploy.
Pro pushState support for single page apps
Great for front ends like React and Vue.
Pro Automatic Gziping
Auto gzips and sends gziped files.
Pro Supports Jekyll and Grunt and other CIs
Pro Far-future expire headers
Pro Support on Slack
Live Chat Support.
Pro ent (intelligently) about trailing slashes (“/”)
Pro Fully featured CLI tool
Provides a CLI tool to easily deploy using terminal with surge
command.
Pro Atomic Deploys
Deployments are fast, instant, and atomic - with zero chance of collisions.
Cons
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
Con Does not support .pdf by default
Does not support .pdf. To get PDF support you have to add a credit card by running surge card
(though no charges apply).
