Migrating My Site From Google Domains and Netlify to Cloudflare

Lloyd Atkinson

I had wanted to migrate my site away from Netlify for some time. It wasn’t a sudden decision; Netlify had been irritating me but not enough to make me move off it1. Then Google, my domain registrar, in possibly some of the worst decision-making by Google since the infamous and much-maligned decision to kill off Google Reader, Google decided to also sell its popular domain registrar service to SquareSpace, of all companies.

After much procrastination and concern, I decided that now was an opportune time to migrate both in one go. Migrating from Google Domains (soon to be SquareSpace) was my number one priority as I wanted to avoid dealing with any potentially complicated process SquareSpace may impose on domain migration.

I’d never moved a domain to another domain registrar before; I’ve never needed to until now. So that was a slightly unsettling prospect. Fortunately, other than an accidental redirect loop and being unable to resolve the site for a few minutes, it was a success.

Riding on this success, I decided I might as well finish the second part: migrating the hosting to Cloudflare Pages.

The number of features and services Cloudflare provides is impressive. I had previously successfully set up a Cloudflare Tunnel that could be reached via a subdomain. It also automatically added the correct CNAME record for a tunnel!

I was now free to choose how I wanted my site to work. I can now securely expose services and APIs from my infrastructure and homelab with their own subdomains: example.lloydatkinson.net. This is something I’ve wanted to do for a while.

Onboarding experience

Although I had already been trying out Cloudflare for some time, as I previously said, I’d never brought a domain over to it. The onboarding for all of this was reasonably smooth. There was a rough edge, though, and I couldn’t find mention of this in the documentation; I needed to set up Cloudflare Pages for both the www and non-www versions. Not doing this caused a Cloudflare error page to be served. Fortunately, Cloudflare staff helped point me in the right direction.

Custom Domains

Performance

The performance of Cloudflare and Cloudflare Pages compared to Netlify is almost comical. I can tell my site feels snappier as a result of the move. Netlify seemingly prioritises the US segment of the internet, whereas Cloudflare aims to serve anywhere in a performant manner.

LocationCloudflare: ConnectCloudflare: TTFBNetlify: ConnectNetlify: TTFB
London, UK2ms59ms17ms790ms
Paris, France16ms51ms21ms569ms
Belgium8ms73ms13ms264ms
Warsaw, Poland1ms31ms25ms279ms
Las Vegas, US8ms62ms18ms178ms
Montreal, Canada9ms81ms34ms73ms
Hong Kong1ms88ms86ms534ms
Tokyo, Japan1ms34ms75ms1000ms

Cloudflare TTFB

I collected these results just once. I considered creating a benchmark script to automate collecting results from several runs. Repeating the test does improve the Netlify performance somewhat. But, with Cloudflare, the first try was significantly better. This is a valuable test by itself; it shows what the experience for a first-time reader is like.

A surprising difference: refreshing does not cause flickering

Continuing the theme of questionable and essentially blackbox Netlify performance, I noticed a pretty unusual but very welcome change. Refreshing the home page constantly does not flicker when it’s hosted on Cloudflare. If I do this when it’s hosted on Netlify, it does! This one again demonstrates the clear performance benefits of Cloudflare.

Form Handling

This is actually one of the few Netlify features Cloudflare doesn’t have built in. My contact form needs updating once I decide how to build this now missing functionality. On the one hand I could easily write a serverless backend that either writes to a database or emails me. On the other hand, FormSpree has a nice free plan but with the unfortunate downside of only thirty days of archives. Most likely I’ll end up writing something myself, in the form of a Cloudflare Pages function.

Summary

I’ll admit I was very apprehensive about migrating my domain. I was worried my site could vanish for days if something went wrong. Fortunately, it was not nearly as scary as I expected. I’m now a happy Cloudflare customer and delighted I have many new possible features at my disposal. The Cloudflare staff were also very helpful in resolving the issue I discussed previously.

Also, I found out just how slow Virgin Media’s DNS cache is. While I could see my DNS changes had propagated around most of the world within an hour, I was still waiting for Virgin Media to catch up over six hours later.

Further Reading

Footnotes

  1. I intend to write a separate post on some of my experiences and concerns with Netlify; it’s everything from company direction, internal politics, questionable acquisitions, and, as demonstrated previously, infrastructure performance.

Share:

Spotted a typo or want to leave a comment? Send feedback

Stay up to date

Subscribe to my newsletter to stay up to date on my articles and projects

© Lloyd Atkinson 2024 ✌

I'm available for work 💡