Integrate LaunchDarkly with Cloudflare featured image

Today, we’re officially launching a Cloudflare integration, providing you with the ability to evaluate flags at the edge. Powered by LaunchDarkly’s Cloudflare Edge SDK, this integration enables flag variation information to be delivered directly within the same Content Delivery Network (CDN) request for content, eliminating the flash of original content and making the experience faster for your end users, thanks to Cloudflare workers.

Your Edge or mine?

Recently, we moved significant portions of our flag evaluation tooling from our core LaunchDarkly infrastructure, out to the CDN layer of our architecture. We refer to this as Flag Delivery at Edge, and it is currently live throughout our LaunchDarkly Flag Delivery Network.

Flag Delivery at Edge takes our already extensive Flag Delivery Network and improves upon it by leveraging our CDN in a smarter and more holistic way. We’re enhancing our caching strategy by moving key services of the LaunchDarkly flag database and initialization system to the edge layer for processing. Previously these components lived within our LaunchDarkly core infrastructure, which in the case of a cache miss, would require user connections to “round-trip” all the way to the core in order to satisfy the request. 

Moving these components to the edge allows us to leverage our CDN (nearly 100 points of presence around the globe) to drastically improve our performance, and raise our cache hit rate. From a “real numbers” perspective, this allowed us to reduce the client initialization time from the hundreds of milliseconds to around 25ms — even in those previously mentioned challenging connectivity scenarios. In some cases, we’ve seen a more than 10x improvement in connection speed as a result of this enhancement.

But wait, there’s more…The Cloudflare integration differs slightly from what’s available out of the box from LaunchDarkly’s Flag Delivery Network. When using the Cloudfare integration, you can evaluate feature flags in your network edge rather than our network edge. This unlocks even greater flag evaluation speeds than what you get with Flag Delivery at Edge.

Business value

Edge evaluation offers numerous benefits. Here’s an example. Imagine you have a heavily-trafficked news site that relies on CDNs for caching. Historically, in this scenario, it would be difficult to use feature flags at scale—to evaluate flags, you’d have to make several roundtrip requests to your server. But the Cloudflare integration removes the need for such requests. You could simply evaluate feature flags within your CDN layer.

This integration enables flag evaluation within Cloudflare Workers by writing up-to-date flag data from the configured environment directly to your Workers KV.

Interested to learn more about Cloudflare Workers? Check out our blog post about handling data at the edge.

Get started today

In order to use the integration, you'll need to set up a KV for your Cloudflare Worker and get an API token from Cloudflare. Read our documentation to get started.

Note: This integration requires LaunchDarkly's Cloudflare Edge SDK and is currently available to all Enterprise customers. 

If you have any feedback want to request another CDN integration, please reach out to our product team at feedback@launchdarkly.com.

Related Content

More about Product Updates

October 17, 2022