Live data from Hacker News

GitHub Pages with a custom root domain is slow

instantclick.io

61–70 of 93 posts

Re: GitHub Pages with a custom root domain is slow

#61
Hey folks, Jesse from GitHub Ops here.

First off, if you use a DNS provider that has support for a ALIAS records or something similar, pointing your apex domain to .github.io will ensure your GitHub Pages site is served by our CDN without these redirects.

I wish we could provide better service for folks without a DNS provider that supports ALIAS domains in the face of the constant barrage of DDoS attacks we've seen against the IPs we've advertised for GitHub Pages over the years. We made the decision to keep DDoS mitigation enabled for apex domains after seeing GitHub Pages attacked and going down a handful of times in the same week. It's a bummer that this decision negatively impacts performance, but it does certainly improve the overall availability of the service.

FWIW, we considered pulling support for GitHub Pages on apex domains about a year ago because we knew it'd be slower than subdomains and would require DNS configuration that would be challenging and frustrating for a large number of our users. However, we ended up deciding not to go that route because of the number of existing users on apex domains.

Re: GitHub Pages with a custom root domain is slow

#62

If you are technical enough to understand (and care about) the implications of this issue, consider hosting on S3. Hosting costs me about $2 per month on lower-traffic websites. The s3_website gem makes it straightforward. Response times are reasonable and inelastic with regard to traffic. If you are aiming for the fastest speed possible, check out the s3_website gem support for Cloudfront - you can host your whole s…

Aren't we all technical enough to understand the implications? The author makes clear, the blog is hosted on DigitalOcean.

The thing is that very few blogger drive enough traffic to make money out of their blog[1]. If that's not the case, then why bother? If the content is good and free then waiting 2 seconds more is acceptable IMHO. :-)

[1]: http://daringfireball.net/ - JG being probably the most prominent example.

Re: GitHub Pages with a custom root domain is slow

#64
post #2

You can actually use CloudFlare and stay on Github pages. In the CloudFlare DNS editor you can point your root at github's cname address and everything will work. If you choose not to enable CloudFlare proxy service you can still use the DNS to flatten Github's cname. See http://blog.cloudflare.com/introducing-cname-flattening-rfc-...

You can, but then you get automated emails from Github Support telling you that your DNS config is wrong and that you should be using CNAMEs rather than A records (since Cloudflare flattens the virtual CNAMEs to As if you do a DNS lookup).

What domain? I'll get an issue filed to stop sending warning emails in cases like this. Thanks!

Re: GitHub Pages with a custom root domain is slow

#66
post #24

The article notes that DNSimple's ALIAS records avoid this problem. Would the same thing be true of CloudFlare's new "flattened CNAME" records?

I didn't see such a note, but I'm not sure it would be true, either. DNSimple doesn't actually implement a new DNS record type, it simply puts a TXT record on your domain that says "ALIAS for some.fqdn", and presumably it causes their DNS servers to do a recursive lookup for you (to whatever's in the TXT record) when you try and look at the A record for the naked domain. From github's DDoS prevention's point of view…

No, the result is not the same. When you look up the records for the .github.io you get a different set of records than the singular IP address they tell you to add if you want to use the apex domain!

So from Github's DDoS prevention's point of view, the result is different.

Re: GitHub Pages with a custom root domain is slow

#67
Great demonstration of the importance of load times!

BitBalloon (https://www.bitballoon.com) will give you better speed with a root domain, but as with any other host you'll still loose out on some of our baked in CDN support if you don't have a DNS host with ALIAS support for apex records.

Re: GitHub Pages with a custom root domain is slow

#68

Earlier quoted context omitted.

Would you like to expound on that at all?

Sure, here are a couple references that form my opinion: https://devcenter.heroku.com/articles/apex-domains http://www.hyperarts.com/blog/www-vs-non-www-for-your-canoni... No doubt there's ways around any problem with a naked domain, but why work so hard on something so trivial? No user has ever turned away from a website because it hadd "www." in front. That said, your naked domain surely needs to redirect to your "…

It's not hard work to skip the "www" these days. DNS providers like Cloudflare support CNAME-like functionality on the apex domain, and if you're using AWS then Route 53 provides special "alias" records which let you hook the zone apex on to an ELB, for example. I'm sure other providers have similar functionality.

As for why, well, personally I prefer the look of a domain without the "www". It looks cleaner to me.

Re: GitHub Pages with a custom root domain is slow

#69
post #21
post #15

>The short solution is, instead of using yourdomain.com, use www.yourdomain.com. Then, redirect the root domain to the www subdomain using a DNS CNAME record. The root can't be a CNAME because no other record with the same name aside of a CNAME can exist. Your domain root also has one SOA and two NS records (and probably one more more MX records if you want to receive mail) See RFC 1912 (Section 2.4)

Damn, didn’t know that. Thanks, I’ll update. Edit: Done, seeing changes will need an F5.

You could also suggest using a free service like:

http://wwwizer.com/naked-domain-redirect

It'll 302 redirect naked domains to www.domain, which will resolve to whatever you've configured it for.

This should let you chain A -> 302 redirect -> CNAME and bypass the GitHub DDoS protection.

Re: GitHub Pages with a custom root domain is slow

#70
Cole with Brace here (http://brace.io). We recommend redirecting the apex domain to a "www" subdomain. Note that even using apex CNAME records (Alias records) are still a new idea, and depending on the implementation may reduce reliability or performance. (https://iwantmyname.com/blog/2014/01/why-alias-type-records-...)

Here are a few resources from our blog that explain the www redirect approach:

- http://blog.brace.io/2014/01/17/cnames-aliases/#cnameconfig

- http://blog.brace.io/2014/01/19/custom-domains-godaddy/ (step 3)

(edited: added resources)

Post reply on HN