Introducing the new and improved Edge Rules!

Posted by:

One of the most widely used features on bunny.net is Edge Rules. They offer a powerful way to control Bunny CDN traffic, allowing you to easily configure caching, load balancing, security settings, authentication, dynamically send traffic to multiple origins, and much more with just a few clicks.

Historically, one of the biggest challenges with Edge Rules was that each rule only executed a single action. However, complex use-cases usually require a set of rules to work together on the same triggers. This meant that, for example, to configure an origin and caching settings for /api/, you would need to create multiple identical rules that trigger on the same set of conditions but perform different actions. As a result, complex services or APIs could easily end up with tens of rules, often relying on each other.

The original interface wasn't optimized to manage such a large set of rules, resulting in a less-than-ideal user experience. At bunny.net, we understand the complexities of CDN traffic management, and in our relentless pursuit of creating exceptional user journeys, we set out to build a better solution.

Today, we're excited to introduce the new and improved Edge Rules for Bunny CDN. The update brings an improved interface, multi-action rule support, and new actions and triggers. We've made Edge Rules not only easier to set up but also more powerful.

Improved user interface

The first improvement on the list is the redesigned Edge Rule browsing interface. Before, complex rules were sometimes hard to read and difficult to find. We solved this with a brand new way of displaying rules that makes it much easier to see where a rule triggers and which actions will be executed.

For better rule management, we introduced a new search and filter view. Now, you can easily find the rules you're looking for using a quick search or filter for the specific type of rule you'd like to see, instead of scrolling through an endless list of rules.

Support for multi-action rules

To address one of the most significant historical challenges with Edge Rules, we are excited to introduce the new multi-action rules. Each Edge Rule can now be configured to trigger multiple actions from a single rule.

For example, a single rule can now be used for mapping /api/ to a separate origin, and making sure that the response never gets cached.

With multi-action rules, you can now replace multiple error-prone rule groups with a single, streamlined rule that performs all the actions for a significantly better experience.

A new "Retry Origin" action

On top of the improved user interface, we are also introducing a new Edge Rule type called Retry Origin. The new rule allows you to dynamically select which requests should send another request to the origin.

This unlocks powerful new ways to interact with multiple origins, such as retrying 503 or even 404 responses to a different server or service. This simplifies many, otherwise very complex scenarios, such as merging multiple backends, load balancing, custom failover logic, and much more.

We leveraged the new Retry Origin rule to build the bunny.net WordPress Offloader feature, which is seamlessly able to look for a file on our Edge Storage, and then failover to the origin in case the file has not been offloaded yet.

A new "Origin Retry Attempt Count" trigger

To work alongside the Retry Origin rule, we also added a new trigger type called Origin Retry Attempt Count. The new trigger allows you to configure advanced failover, authentication, or reporting metrics when retrying the origin request, such as dynamically changing the Origin URL, adding origin-specific headers, or response headers to use.

Give your online presence an edge!

The new Edge Rules are already available for everyone via both the dashboard and the Bunny API. If you're struggling with complex configurations for your web services or existing massive rule sets or just getting started, make sure to give them a try!

The future of Edge Rules

At bunny.net, we're driven by constant innovation, and we’re continuously working to improve and expand the capabilities of the platform. To unlock even more powerful use cases, we're currently also working on Edge Rules PRO with the following:

  • Regex support: Allowing for more advanced pattern matching in rules and exposing those using variable expansion
  • Increased rule limits: Raising the limit on the number of rules you can create.
  • Advanced triggers and actions: Adding even more advanced triggers to support load balancing, advanced configuration, rule chaining, and more.

We can't wait to share more!

If there are features you would like to see added to Edge Rules to make them even more powerful for you, make sure to let us know. We're always looking for new ideas on how to best help developers make the internet hop even faster!