logo Edgio
Products
Solutions
Learn
Company
dark-gradient.jpg
Blog

Rules Engine: Rules to live by for better CDN performance

By: Edgio | December 18, 2020
Print Article

At Edgio, formerly Verizon Media, our commitment to providing our customers with best-in-class products and solutions is ongoing, which is why we’ve introduced improvements to our Rules Engine technology. The latest version of Rules Engine provides a better overall user experience and the flexibility to keep configurations simple, or they can be customized to fit your business's specific needs. These custom rules handle how our edge servers cache and grant access to our platform, for example, overriding TTL, URL redirection, URL rewrite, access control, geoblocking, and more.

Rules Engine features and match conditions

Rules Engine includes many valuable features, each defining the type of action to be applied to the type of request identified by a set of match conditions. A match condition identifies specific types of requests for which a set of features is to be performed. For example, match conditions focusing on location identify requests based on the requester's location, such as country, continent, region, or postal code. For a complete list of match conditions, visit our technical documentation page.

Rules Engine CDN configuration and control

Rules Engine includes capabilities that give you even greater control and flexibility to optimize the end-user experience. These powerful new capabilities include:

1. No rule limits: There is no limit on the total number of allowed rules and the total number of matches and features within a rule. Categorized matches and features are now easier to find, with new features being added to the mix, including streaming optimization and geolocation match conditions.

2. Staging environment: With the Rules Engine staging environment, you can proactively test rules before deploying them to production without affecting live traffic. You can also test various CDN features and check their compatibility and/or interactions end-to-end, from the client to the CDN and CDN to the origin.

Rules Engine staging environment

Rules Engine staging environment

3. Streamlined deployment workflow: A Policy can be quickly applied to the Staging or Production environment. A history of deploy requests is provided to facilitate tracking changes applied to those environments.

4. Policy versioning: This allows you to store multiple rule variants, so you are ready for future deployment and easy rollback if needed. Versioning lets you keep track of rule changes over time and see who updated a Draft, locked a Policy, or submitted a Deploy Request.

5. New UI: The user interface has been updated, making it easier to set up rules, including making it easier to draft, deploy and roll back policies to your production or staging environment.

  • Rule comparison tool: The Compare function is a powerful new capability that enables you to compare one Draft or Policy with another Draft or Policy to identify differences easily. This can be very useful for troubleshooting or management purposes before/after applying a new policy.

Rule comparison tool

Rule comparison tool

  • XML Export and Import: Once rules are created in the rule builder, you can export the configs in XML format. You can also modify the rules in XML format and import them into a new draft on the same or different accounts.

6. REST APIs: Our robust suite of API endpoints enable DevOps to automate the configuration and deployment of Rules Engine. They can create and update policies, track propagation status and pull a list of active rules by CNAME or origin.

‍Rules Engine use cases

‍There are many instances where Rules Engine can help you tackle your business goals. Here are just a few. For a complete list of features, visit our technical documentation page.

1. Access: These features control access to content. Examples include Error 403 Access Denied/Forbidden and token-based authentication.

Use case example – Geoblocking: If the matching country does not match the U.S., you can block with a 403 Access Forbidden response.

Geoblocking rule example

Geoblocking rule example

Use case example: Rules Engine creates and manages token-based authentication to secure content at the edge and the origin. Rules Engine allows token-based authentication to be enabled/disabled by request type. You can leverage this capability to tailor the set of requests that require authentication based on expiry time, allow/deny based on country, allow/deny based on referrer domain, and/or allow/deny based on client IP. Rules-based tokens can then be generated via the UI or programmatically using the Edgio CDN API/Binaries.

2. Caching: These features customize when and how content is cached. Examples include Bypass Cache, Force Internal Max-Age, External Max-Age, and Cache-Control Header Treatment.

Use case example: By default, the CDN honors the cache policy from the origin. However, you may override the TTL values and ignore the no-cache policy from the origin. The example below shows how this is accomplished.

Force Internal Max-Age rule example

Force Internal Max-Age rule example

Use case example: External Max-Age determines the time that will pass before a browser can check for a new version of an asset from an edge server.

External Max-Age rule example

External Max-Age rule example

3. Headers: These features add, modify, or delete headers from the request or response. Examples include Modify Client Request Header and Modify Client Response Header.

Use case example: The Modify Client Response Header overwrites, appends, or deletes a header from a response. The example below is designed to match any HTTP request and then overwrite a certain CORS (Cross-Origin Resource Sharing) header sent back to the client.

Modify Client Response Header rule example

Modify Client Response Header rule example

4. Logs: These features customize the data stored in raw log files. Examples include Mask Client Subnet and Custom Log Field.

Use case example–General Data Protection Regulation (GDPR) compliance: With Mask Client Subnet, you can determine whether a client’s IP address will be masked for logging and reporting purposes. For example, applying this feature to a client whose IP address is 100.100.200.50 would result in the following masked IP address: 100.100.200.0

5. URL: These features allow a request to be redirected or rewritten to a different URL. Examples include URL Redirect and URL Rewrite. Depending on the particular use case's objectives, you may prefer to use a redirect or a rewrite. A URL Redirect is a client-side action that instructs the web browser to go to another URL, and that new URL is reflected in the browser. A URL Rewrite is a server-side action that will not change what you see in the browser because the user's changes are hidden.

Use case example: You might use URL Redirect to redirect HTTP to HTTPS. Not only do HTTPS sites typically rank higher in search engine results, but they also secure your website, providing a better user experience.

Use case example: URL Rewrites can be used for content distribution and targeting across multiple origins using a single flat client/browser URL. The rewrite mechanism functions at the edge and switches requests between multiple origins or servers based on a set of match conditions.

The Edgio Rules Engine gives you granular control and visibility into your business rules with the ability to customize them to fit the complexity of your business. Whether the focus is media distribution, delivering firmware, software, gaming updates, or faster websites, Rules Engine provides ultimate control over how content is cached and delivered.

Get more information

Contact us to learn more about how Rules Engine can support your business needs, delivering better user experiences.

Hero Texture Shield 2000x1220

Move to the Leading Edge

Get the information you need. When you’re ready, chat with us, get an assessment or start your free trial.