In the next couple days we’re going to be rolling out a feature that’s been in the works for quite some time: Cloudflare for all.
In the first phase, we’ll be making this available to all paid main cluster (non-dedicated) users, and over the coming weeks we’ll be expanding it to include all users, from free tier to dedicated.
For the uninitiated, Cloudflare is an edge network provider. In mostly non-technical terms, this means that they run data centers all over the world, close to your users. When a user makes a request, Cloudflare routes the request intelligently to the closest Bubble server or, if it can fulfill the request from a cache (for instance by serving up your static app code and images), it doesn’t even have to send the request to Bubble at all.
In completely non-technical terms, this means your pages are going to start getting faster. In many cases, a lot faster.
What does this mean for you?
If you’re going to be setting up a domain for the first time in the near future—not much. You will register your domain, enter it in the Bubble editor, hit submit, and be given a record to enter at your registrar (for instance, GoDaddy). Once you’re all done, you’ll get all the benefits of being on the Cloudflare network seamlessly, and gain the benefit of every new feature as they’re enabled.
For existing customers the process can be slightly more complicated.
To opt into our Cloudflare plan requires that you change your domain records with your registrar, and then both Bubble and Cloudflare verify that your domain is configured correctly. In our testing, this process typically takes about 2 seconds, assuming all records are configured correctly and that there are no errant domain records. (More on this below.) However, if the domain is misconfigured and cannot be verified, it could result in downtime.
For this reason, for legacy users (those who had a registered domain prior to the rollout), Cloudflare is opt-in.
A best-case workflow for legacy users might look like this:
- You currently have your custom domain,
example.com, pointed to a Bubble record of the form
220.127.116.11via an A record
- You verify that your registrar supports ANAME or ALIAS records
- You click the checkbox to opt-in to Cloudflare
- The Bubble server automatically issues an order to Cloudflare to register
example.comas an app on our service
- When the order has been placed, you receive instructions to direct your domain name to the new endpoint at
- You go back to your registrar and replace your A record pointing to
18.104.22.168with an ANAME record pointing to
- (Optional) Click “Check my settings” to re-trigger validation. If both Cloudflare and Bubble can find your app at
app.bubble.io, then you’ll receive a message that you’re good to go, and everything should just work!
Of course, with something as complex as the domain record system, it’s likely your transition won’t be quite this easy. (This is, in fact, a big reason we chose to add this feature to the Bubble platform.)
What can you do to get the full benefit of this changeover, as smoothly as possible?
If your your app is at
The most common examples of this type are of the form
app.example.com. In this case, follow the directions above and you shouldn’t have any issues.
If you currently have a domain of the form
If you want to keep your domain as-is, without adding www, ensure your registrar supports ANAME or ALIAS records before opting in. (Note that GoDaddy, one of the most popular registrars, does not support ALIAS or ANAME records.)
If your registrar doesn’t support ANAME records, consider transferring your nameservers to a different DNS provider. (You can keep your current registrar.) Cloudflare’s free tier DNS supports CNAME records on bare domains, for instance, which is equivalent to an ANAME record.
If you’re comfortable switching to the form
Bubble will provide you with a CNAME record that looks like the following:
CNAME www app.bubble.io
Enter this at your registrar, and you should be good to go!
The downside of this is that this change may affect your SEO, and if your users have existing bookmarks to your current domain, they may need to update them.
www and bare domains
In either case, many of your users are liable to type in
www.example.com when your site is hosted at
example.com, or vice versa. Historically, we’ve redirected all requests from www to the bare domain. Once this feature is rolled out, if we receive a request for a bare domain and your site is located at www, we will redirect in that direction instead.
You will probably need some means of handling both types of records. We suggest that you use the CNAME/ANAME option, like this:
CNAME www app.bubble.io
ANAME @ app.bubble.io
@ is a common convention for referring to the bare domain.)
Here are some examples of how to configure ANAME/ALIAS records from around the web:
But again, different registrars will offer different solutions.
On Cloudflare DNS, your records might look like this:
CNAME www app.bubble.io
CNAME @ app.bubble.io
Read more here
Meanwhile, my registrar supports a feature where I can have www redirect to the bare domain, or vice-versa, without using ANAME records at all. Yours might as well.
We’ve worked hard to make this feature as painless as possible, and as always our Success Team and fellow forum users will be here to help you through the process of transitioning over, should you choose to do so.
Setting up custom domains is consistently one of the most error-prone processes our users deal with, and over time Cloudflare for all should eliminate a lot of these pain points, while making your Bubble apps faster!