# Hosting: Amazon S3 vs GitHub gh-pages vs?

**URL:** <https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340>\
**Category:** support\
**Created:** [November 18, 2014, 11:22pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340 "2014-11-18T23:22:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 18, 2014, 11:22pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/1 "2014-11-18T23:22:48Z")

</div>

I have a couple of low-traffic sites ported to Hugo. They currently run from a gh-pages branch on GitHub.

Lots of things to love about this setup, deployment is a button pushed.

The only downside I found, which isn’t a big downside for me, is the fixed 10 minute cache timeout on static resources.

I could get better control with this on Amazon, but are there other reasons? It’s not about the money for me, I would be happy to chip out some money to Amazon if they could add some value.

---

<div class="post-metadata">

**Author:** ![oscar\_b](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oscar_b/32/40_2.png) [@oscar\_b](https://discourse.gohugo.io/u/oscar_b)\
**Post date:** [November 19, 2014, 12:25pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/2 "2014-11-19T12:25:19Z")

</div>

Can’t give any pros and cons, but I’m using S3 to host a bunch of static sites, and it’s working beautifully. The only thing I can think of is that it might be a requirement to also use Route 53 (Amazon DNS) for you domain since you can’t use CNAME on your naked domain. It’s a really good service as well though.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 27, 2014, 7:24pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/3 "2014-11-27T19:24:07Z")

</div>

Thanks for the input.

I’m going with Amazon for three reasons:

1. GitHub insists on doing a 302 redirect for all other setups than a CNAME, and my current providers do not support that on the “naked domain”. This is a SEO bugger.
2. GitHub defaults the cache timeout for static files to 10 minutes, which may be fine for most people, but annoying when I have set up scripts that fingerprints my statics.
3. My domain names / hostings are a little too spread out at the moment. Might as well put it all in the place where I buy my shoes.

My domain name transfers are in progress, but I must say setting up S3 and deployment to it was easy. Three lines in a Gulp file (and some more, but still easy).

---

<div class="post-metadata">

**Author:** ![fale](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/fale/32/112_2.png) [@fale](https://discourse.gohugo.io/u/fale)\
**Post date:** [December 8, 2014, 11:55am UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/4 "2014-12-08T11:55:09Z")

</div>

> [@bjornerik](#):
>
> GitHub insists on doing a 302 redirect for all other setups than a CNAME, and my current providers do not support that on the “naked domain”. This is a SEO bugger.

This is right, see RFC1034 section 3.6.2 for details.

> [@bjornerik](#):
>
> My domain name transfers are in progress, but I must say setting up S3 and deployment to it was easy. Three lines in a Gulp file (and some more, but still easy).

Are you deploying on a single zone? Are you using the CDN?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [December 8, 2014, 12:43pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/5 "2014-12-08T12:43:51Z")

</div>

No CDN (currently).

I have now ported two sites to Amazon.

- Route 53: One zone each
- S3: Two buckets each ([mysite.com](http://mysite.com) and [www.mysite.com](http://www.mysite.com)), the latter redirects to the first

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [December 8, 2014, 2:09pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/6 "2014-12-08T14:09:01Z")

</div>

I’ve posted this in another thread, but for completeness, the aws-publish Gulp task in the file below shows one way to set suitable cache values for static content on S3.

> <https://github.com/bep/bepsays.com/blob/master/gulpfile.js>

---

<div class="post-metadata">

**Author:** ![fale](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/fale/32/112_2.png) [@fale](https://discourse.gohugo.io/u/fale)\
**Post date:** [December 13, 2014, 2:03pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/7 "2014-12-13T14:03:59Z")

</div>

Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![interglobalmedia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/interglobalmedia/32/3209_2.png) [@interglobalmedia](https://discourse.gohugo.io/u/interglobalmedia)\
**Post date:** [May 30, 2017, 7:12pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/8 "2017-05-30T19:12:27Z")

</div>

Hi,

I want to go the gh-pages route for now and use a custom domain. I presently have a WordPress install on a hosting service, but have created a Hugo website that is being hosted on Github. I have also already created the gh-pages branch for it. Since I haven’t yet removed the WordPress install, that is what is showing up on gh-pages at the moment. In order for my Hugo site to replace it, what do I need to do? As I mentioned, the custom domain is an active one. I have not gotten any definitive working answer from my hosting service (for obvious reasons), and no responses on the thread I created here. I also haven’t gotten any responsve from Github support. This is my first time doing this. So I thought I would give it a try here, since the topic is somewhat related. Thanks in advance for any feedback. Much appreciated!

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [May 30, 2017, 7:54pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/9 "2017-05-30T19:54:17Z")

</div>

You have created a thread about your issue. Adding that same question to multiple threads isn’t getting you anywhere closer to a solution. It just adds noise.

---

<div class="post-metadata">

**Author:** ![interglobalmedia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/interglobalmedia/32/3209_2.png) [@interglobalmedia](https://discourse.gohugo.io/u/interglobalmedia)\
**Post date:** [May 30, 2017, 7:57pm UTC](https://discourse.gohugo.io/t/hosting-amazon-s3-vs-github-gh-pages-vs/340/10 "2017-05-30T19:57:03Z")

</div>

@bep I am trying to get rid of my original thread since it doesn’t seem to be getting me anywhere. Not trying to create noise. Just trying to get an answer which no one seems to be able to provide yet. But I can’t seem to be able to delete it. I guess I will just try and get my answer elsewhere. Thanks anyway!
