tencent cloud

Tencent Cloud EdgeOne

Release Notes and Announcements
Release Notes
Security Announcement
Announcements
Product Introduction
Overview
Strengths
Use Cases
Comparison Between EdgeOne and CDN Products
Use Limits
Purchase Guide
Description of Trial Plan Experience Benefits
Free Plan Guide
Billing Overview
Billing Items
Subscriptions
Renewals
Instructions for overdue and refunds
Comparison of EdgeOne Plans
About "clean traffic" billing instructions
DDoS Protection Capacity Description
Getting Started
Choose business scenario
Quick access to website security acceleration
Quick deploying a website with Pages
Domain Service&Origin Configuration
Domain Service
HTTPS Certificate
Origin Configuration
Site Acceleration
Overview
Access Control
Smart Acceleration
Cache Configuration
File Optimization
Network Optimization
URL Rewrite
Modifying Header
Modify the response content
Rule Engine
Image&Video Processing
Speed limit for single connection download
DDoS & Web Protection
Overview
DDoS Protection
Web Protection
Bot Management
API Discovery(Beta)
Edge Functions
Overview
Getting Started
Operation Guide
Runtime APIs
Sample Functions
Best Practices
Pages
L4 Proxy
Overview
Creating an L4 Proxy Instance
Modifying an L4 Proxy Instance
Disabling or Deleting an L4 Proxy Instance
Batch Configuring Forwarding Rules
Obtaining Real Client IPs
Data Analysis&Log Service
Log Service
Data Analysis
Alarm Service
Site and Billing Management
Billing Management
Site Management
Version Management
General Policy
General Reference
Configuration Syntax
Request and Response Actions
Country/region and Corresponding Codes
Terraform
Overview
Installing and Configuring Terraform
Practical Tutorial
EdgeOne Skill User Guide
Automatic Warm-up/Cache Purge
Resource Abuse/hotlinking Protection Practical
HTTPS Related Practices
Acceleration Optimization
Scheduling Traffic
Data Analysis and Alerting
Log Platform Integration Practices
Configuring Origin Servers for Cloud Object Storage (Such As COS)
CORS Response Configuration
API Documentation
History
Introduction
API Category
Making API Requests
Site APIs
Acceleration Domain Management APIs
Site Acceleration Configuration APIs
Edge Function APIs
Alias Domain APIs
Security Configuration APIs
Layer 4 Application Proxy APIs
Content Management APIs
Data Analysis APIs
Log Service APIs
Billing APIs
Certificate APIs
Origin Protection APIs
Load Balancing APIs
Diagnostic Tool APIs
Custom Response Page APIs
API Security APIs
DNS Record APIs
Content Identifier APIs
Legacy APIs
Ownership APIs
Image and Video Processing APIs
Multi-Channel Security Gateway APIs
Version Management APIs
Data Types
Error Codes
FAQs
Product Features FAQs
DNS Record FAQs
Domain Configuration FAQs
Site Acceleration FAQs
Data and Log FAQs
Security Protection-related Queries
Origin Configuration FAQs
Troubleshooting
Reference for Abnormal Status Codes
Troubleshooting Guide for EdgeOne 4XX/5XX Status Codes
520/524 Status Code Troubleshooting Guide
521/522 Status Code Troubleshooting Guide
Tool Guide
Agreements
Service Level Agreement
Origin Protection Enablement Conditions of Use
TEO Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Overview

PDF
Focus Mode
Font Size
Last updated: 2024-08-01 21:32:16

Overview

The rule engine is designed to meet more flexible and fine-grained business requirements through a rich rule language. You can customize the match type as needed and apply it to the corresponding operations. Compared to the configuration of site acceleration, the priority of the rule engine is higher, meaning that the custom policies created by the rule engine will override the configurations of site acceleration.

Use Cases

Provide custom configurations based on different conditions (subdomain name, path and file extension) when site-level configuration in Site Acceleration cannot meet your needs.
Provide basic features (caching and HTTPS) and acceleration features (custom cache key, URL rewrite and HTTP header modification).

Key Terms

Term
Description
Rule
It defines specific types of requests and the applicable operations.
Conditional Expression
It defines the logics that identify the requests. The followings are supported.
IF Note 1
ELSE IF
ELSE
Matching Condition
It defines the criteria that identifies the requests. The followings are included.
Matching type
Operator
Value
And/Or
Logical AND/OR, which can link multiple conditions.
Action
A wide range of feature configurations that can be applied to hit requests.
Note:

Note 1:
An IF statement can be nested inside another IF statement, indicating that the nested one will be executed only after the other is met.

Rule Priorities

Range
Description
Site Acceleration vs Rule Engine
If the same operation is configured for both site acceleration and the rule engine, the rule engine has a higher priority and is the final effective configuration.
Single rule in the rule engine
If there exist nested IF conditions within an IF statement, the execution of the embedded IF statement necessitates the fulfillment of the outermost IF condition.
In the event of multiple coequal IF conditions, they are executed in relative order from top to bottom. That is, if multiple rules are matched simultaneously, the operations of the lower rules will supersede those of the upper rules.
In the event that IF, Else IF, and Else coexist, upon satisfying any one of the IF or Else IF conditions, the corresponding operation will be executed and concluded, precluding further matching of other rules under the current IF condition. If none are met, operations will be executed in accordance with the Else rule.
Multiple rules in the rule engine
The rules are executed in relative order, from top to bottom.
Note: You can place general or coarse-grained rules at the top as the default configuration and request-specific or finer-grained rules at the bottom.
Note:
There are two scenarios with special execution:
Token authentication will be executed first no matter where it is placed. If a request hits two rules, token authentication will be executed first, as other operations will be performed only after authentication is passed.
For operations with redirect logic, such as URL redirection and forced HTTPS, their execution method is Break. This means that if the same request encounters both a redirect operation and other operations, the other operations below will not be executed after the redirect operation is executed.


Example of Rule Priorities

Example One: Nested IF Conditions within IF Matches

The current user's node cache TTL rule configuration is as follows, with multiple nested IF conditions present.



The caching behavior of the user-requested URL is activated as follows:



When the request URL is: https://test.example.com/example/1.jpg, the file is cached for a duration of 10 minutes.
When the request URL is: https://test.example.com/example/1.mp4, the file is not subjected to caching.
When the request URL is: https://test.example.com/video/1.jpg, it does not conform to the stipulated rule.

Example Two: IF Condition Contains Multiple Parallel Else IF Matches

The current user's node cache TTL rule configuration is depicted below, with multiple coequal Else IF conditions present.



The caching behavior of the user's requested URL will take effect as follows:



When the request URL is: https://test.example.com/image/1.jpg, the file is cached for a duration of 7 days.
When the request URL is: https://test.example.com/index/1.jsp, the file is not subjected to caching.
When the request URL is: https://test.example.com/admin/1.php, caching is not implemented.

Example Three: Multiple Peer-Level IF Condition Matching

The current user's node cache TTL rule configuration is as follows. In the presence of multiple peer IF conditions, the effectiveness priority sequence of the subsequent conditions is the highest.



The caching behavior of the user's requested URL is activated as follows:



When the request URL is: https://test.example.com/image/1.jpg, the file is cached for a duration of 7 days.
When the request URL is: https://test.example.com/admin/1.php, the file is not subjected to caching.
When the request URL is: https://test.exampel.com/admin/1.jpg, the file is not subjected to caching.
When the request URL is: https://test.exampel.com/index/1.txt, the file adheres to the source site's Cache-Control header settings. In the absence of such a header, it complies with the default caching policy of EdgeOne.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback