Increase the Bubble page load speeds with Cloudflare

Well, we don’t officially support this right now, and we’ve seen a couple users have issues with our domain setup code since it assumes that users point domains directly at Bubble.

We’re investigating what Cloudflare is doing that causes the speed ups. Depending on what we find, we may incorporate those differences into our own code, making Cloudflare unnecessary, or we may officially recommend using Cloudflare and build support for it. (Any information users have who’ve tried Cloudflare and seen improvements would be helpful).

12 Likes

Any further information about your investigation into Cloudflare? Just curious if you were making any changes to the platform based on the potential speed boosts?

1 Like

Did this yesterday and so far it works great and no problems with my domain setup. Went down from 5s to 667 ms.

2 Likes

just a heads up to those who are using this solution - cloudflare may affect Google Analytics plugin that you use in Bubble like it did for us at zeroqode.com - we saw a decrease in visitors since we used cloudflare although there was no objective reason for that.
So the solution as we tested it is to remove the google analytics plugin from Bubble app (and deploy) and then to enable the Google Analytics app in cloudflare - here is the link to that app Cloudflare Apps
hope this helps
Thanks

Levon Terteryan
Founder @ Zeroqode & Bubblewits

zeroqode-for-web-160x120

Bubble Templates
Bubble Plugins
Bubble Courses
Convert Web to iOS & Android
No-code Development Services

2 Likes

Out of nowhere, my loading speed went down again. It’s slow and unstable. Google insight is showing red signs as well.

Hi there :slight_smile:

the advice in this post was really great, where I could improve my page’s speed from initially between 2.5 - 2.8 seconds down to between 1.02 and 1.5 seconds in average, which worked fine for a while. But just like @jaos.pcl I have experiences that those values have gone up over the time again, without anything I would have changed from my side. Are you experiencing the same effect, and has anyone found the root cause for this? Right now the page is even slower to where I started from (the average now is 3.5 - 4 seconds of load time)… are there maybe any developments happening on Bubble-side that would effect the loading speed that heavily?

I’ve removed Cloudflare from my name server.

When I use Cloudflare, Bubble tells me my app is not correctly set up in the domain/email panel and when I try to preview the version-test, even though it actually works. Is it the same for you, @levon?

yes, it’s the same for us

All right, thanks!

Thanks for the tutorial, @levon!

The before and after from one of my sites:

Before

After

It is an improvement, albeit not mind-blowing. I have signed up for the Pingdom service and I will monitor the speed performance during a week to see if/how it changes.

Speaking of improvements, are those performance insights below the results valuable feedback? Some of the red and orange ones look like stuff only Bubble itself could change. Or is there something I can do to, for example, “combine external JavaScript”?

I think those can be done only by Bubble, we don’t have any control over them. We recently noticed that the speed improvements with cloudflare are not that significant anymore. Either Bubble changed something, or Cloudflare (i’m guessing Bubble optimized something on their side)

@levon I just opened a ticket with Cloudflare. Not sure what changed, if it was on Bubble side or Cloudflare, but while the initial response time for my page has increased steadily over the last weeks, it has now gone from 1.x seconds to 6 seconds… which really forces me to act now

1 Like

Just got the following reply by Cloudflare:

"Looking at the result you have share, I have also run some tests on our side, looks like much of your content is external here, which CloudFlare can’t cache.
https://www.webpagetest.org/result/180801_5N_8b55023e267acebb0d7924f4db41278d/1/domains/
CF Page Weight # Size %


Cache HIT 3 5.73KB 0.17%
NOT Caching 13 32.38KB 0.97%
External 80 3306.88KB 98.86%
Total 96 3344.99KB 100.00%
This shows the number of external requests you have here, broken down by domain name. You’d need to look at two things here:
• Cutting down the overall number of requests you’re serving on a single page.
• Looking at how long your external assets (from facebook, youtube etc) take to load, and whether this can be optimised.
I suggest checking with your web developer/server admin if you are unable to find the reasoning.
Hope that helps."

Given the fact that it worked fine at the beginning when I integrated Cloudflare @josh : Have there maybe been any changes on Bubble, that would affect such effect lately?

1 Like

@josh @emmanuel could you maybe think of sth that could have had this impact?

Great tip, thanks @levon. Besides for the drawback noted by @Lucien has anyone else noticed any other reasons why doing this may not be a good idea?

I’ve used cloudflare for a long time on another (Adobe Muse authored) site and it is quite helpful in that context. When I tried with my Bubble app, though, there’s so much that I do dynamically that putting CloudFlare up front just didn’t help and also caused what I viewed as unintended behavior.

Some of the most useful CF features like the “RocketLoader” try to intelligently rewrite/change execution order of scripts and this doesn’t work with every case. (Some pages that use certain Muse plug-ins for example won’t play nice.)

The other thing that will affect ANY Bubble site is that — if you’re doing active/iterative development and changes to your site — of course you will have to turn cacheing off or you will not be able to test your page changes. (Theres a dev mode toggle in CF for quickly and temporarily doing this, but you need to remember!)

Anyway CF would be a fine idea for static-ish sites built in Bubble or for the static portions of one’s site, etc., but note that if you need s lot of different pages with different CF settings, you quickly find yourself in paid plan territory as the free tier only gives you a small number of customizations.

I’m actually surprised their are so many reports of good results with CF on Bubble sites in this thread as, at least for the app I’m working on, it wasnt wildly beneficial.

Anyway, it’s a super cool idea worth trying, but it’s definitely YMMV depending on the nature of your site/app.

4 Likes

@keith, thank you for the helpful reply. That’s exactly the kind of experience I was curious about. Good to know that making this change isn’t without its caveats.

– For other’s with custom domains using Bubble for SSL –

You may want to update how you’ve configured cloudflare. We implemented cloudflare a few months ago and learned the the default settings prevent the Bubble cron from renewing the SSL cert (which occurs every 3months). If your SSL is set to full, perhaps you and your users have run into a 525 error this creates.

The solution is:

  1. SSL set to full
  2. Toggle HTTP → HTTPs redirect to off (in crypto tab)
  3. On page rules tab, create the following page rule
3 Likes

Thanks @kramwe

Do you guys still notice speed improvements using Cloudflare?