Tencent Cloud EdgeOne

Tencent Cloud EdgeOne
Site Acceleration
Product Documentation©2013-2022 Tencent Cloud. All rights reserved.

Page 1 of 245

Tencent Cloud EdgeOne

Copyright Notice©2013-2024 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distributein any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing)
Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned bytheir respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services
only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are
subject to change. Specific products and services and the standards applicable to them are exclusively provided for in
Tencent Cloud's applicable terms and conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 2 of 245

Tencent Cloud EdgeOne

Contents
Site Acceleration
Overview
Access Control
Token Authentication
Introduction to Token Authentication
Authentication Method A
Authentication Method B
Authentication Method C
Authentication Method D
Authentication Method V
Smart Acceleration
Cache Configuration
Overview
EdgeOne Cache Rules
Content Cache Rules
Cache Key Introduction
Vary Feature
Cache Configuration
Custom Cache Key
Node Cache TTL
Status Code Cache TTL
Browser Cache TTL
Offline Caching
Cache Prefresh
Clear and Preheat Cach
Cache Purge
URL Pre-Warming
How to improve the Cache Hit Rate of EdgeOne
File Optimization
Smart Compression
Media processing
Image Processing
Network Optimization
HTTP/2
HTTP/3(QUIC)©2013-2022 Tencent Cloud. All rights reserved.

Page 3 of 245

Tencent Cloud EdgeOne

Overview
Enable HTTP/3
QUIC SDKSDK Overview
SDK Download and Integration
Sample CodeAndroidiOS
API Documentation
AndroidiOS
IPv6 AccessMaximum Upload Size
WebSocket
Client IP Geolocation Header
Client IP Geographical LocationgRPC
URL Rewrite
Access URL Redirection
Origin-Pull URL Rewrite
Modifying Header
Modifying HTTP Response Headers
Modifying HTTP Request Headers
Custom Error Page
Request and Response Actions
Processing order
Default HTTP Headers of Origin-Pull Requests
Default HTTP Response Headers©2013-2022 Tencent Cloud. All rights reserved.

Page 4 of 245

Tencent Cloud EdgeOne

Site Acceleration
Overview：

Last updated 2023-08-30 15:25:36
Site acceleration service is specifically designed for internet content delivery acceleration services such as
HTTP/HTTPS application layer protocols, especially suitable for the distribution of websites, online applications,streaming media, and other content. Site acceleration can help you achieve more efficient and stable content delivery
through a wealth of functional configurations, such as cache optimization, file optimization, network optimization, etc.,
to improve the satisfaction of business users and enhance the competitiveness of your website, application, or other
online services.
After accessing the EdgeOne security acceleration service, you can customize the following site acceleration services:
Rule type

Function

Usage Scenarios

AccessToken

EdgeOne nodes authenticate client access

controlauthentication﻿

to prevent unauthorized behavior.

Off

Smart acceleration for dynamic resource
access requests to improve access speed.

Off

Differentiate node cache content based on
the Vary header in the origin response, andrespond to corresponding resources basedon the specified header content.

Globally enabled bydefault on the platform

Custom CacheKey﻿

Customize the cache key (Cache Key) of
the file in the node to determine the cachingrules and whether to hit the cache.

By default, the character
cache is not ignored. For
details, please refer tothe introduction of
Cache Key.

Node cache TTL﻿Customize the cache time of the file in thenode to determine whether the file should becached in the EdgeOne node and thecorresponding cache time.

Please refer to thedefault cache rules of
EdgeOne nodes.

Status code
cache TTL﻿Customize the cache time of error status
codes in EdgeOne nodes to reduce thepressure of origin-pull requests when theorigin is abnormal.

Cache 404 for 10s,
other exception status
codes are not cached.

Browser cache
TTL﻿Control whether the browser caches files toreduce access request traffic.

By default, follow theorigin Cache-Control.

Smart acceleration﻿
Cache
configuration

Default Configuration

Vary feature©2013-2022 Tencent Cloud. All rights reserved.

Page 5 of 245

Tencent Cloud EdgeOne

Offline cache﻿Control whether EdgeOne uses cached files

Enable(even if the file has expired) to respond toclient requests when the origin is abnormal,
ensuring normal service response when theorigin is abnormal.

File
optimization

Cache prerefresh﻿Let EdgeOne nodes verify the validity of thefile before the cache expires, ensuring thatthe latest resource files are cached in the
node.

Off

Smart
compression﻿

EdgeOne nodes perform Gzip compression
or Brotil compression to reduce filetransmission size.

Enable Gzip
compression and Brotil
compression

EdgeOne nodes automatically scale andconvert image formats, eliminating the needfor multiple sizes and formats of image
copies on the origin, reducing image storage
costs.

Media
processing

Image
processing﻿

Network
optimization

HTTP /2﻿

Require EdgeOne nodes to support HTTP/2
access.

EnableHTTP/3﻿

Require EdgeOne nodes to support HTTP/3
access.

Off

IPv6 access﻿

Require EdgeOne nodes to support IPv6
access.

Off

Off

EdgeOne nodes limit the maximum file size
Maximum uploadsize﻿

that users can upload to prevent malicious
uploads of large files and reducetransmission traffic.

Enable, maximum limitof 800MB

Require EdgeOne nodes to support
WebSocket﻿

Client IP header﻿

WebSocket transmission and configure
timeout connection duration.
Specify the request header to carry theclient IP when EdgeOne nodes origin-pull.

Client IP

Specify the request header to carry thegeographic

client IP geographic location whenlocation header﻿

EdgeOne nodes origin-pull.

Enable gRPC﻿

Require EdgeOne nodes to support gRPC

©2013-2022 Tencent Cloud. All rights reserved.

Off

Off

Off

Off

Page 6 of 245

Tencent Cloud EdgeOne

access.
Rewrite access
URL﻿

Customize the redirection of the user's
access URL address.

Origin-pull URL

Customize the redirection of the user's

rewrite﻿origin-pull request URL address.

Modify HTTP

Customize the modification of HTTP

node response

headers carried by EdgeOne nodes when

headers﻿

responding to user requests.

Modify HTTP

Customize the modification of HTTP

origin-pull
request headers﻿

headers carried by EdgeOne nodes when
origin-pulling.

N/A

URL Rewrite

Modifyheaders

N/A

N/A

N/A

Customize the modification of the error page
Custom error page﻿displayed to the client when the origin
responds with 4xx and 5xx status codes.

©2013-2022 Tencent Cloud. All rights reserved.

N/A

Page 7 of 245

Tencent Cloud EdgeOne

Access Control
Token Authentication
Introduction to Token Authentication：

Last updated 2024-08-14 19:04:36

Overview
Token authentication is a simple and reliable access control policy that verifies URL access through authentication
rules, effectively preventing malicious brushing of site resources. The usage of this feature requires the cooperation of
the client and EdgeOne. The client is responsible for initiating an encrypted URL request, and EdgeOne is responsible
for verifying the validity of the URL based on pre-set rules.

Principle
The implementation of Token authentication mainly consists of the following two parts:
Client: Initiate an authentication URL request based on authentication rules (including authentication algorithm andkey).
EdgeOne node: Verify the authentication information (md5 string + timestamp) in the authentication URL. When theauthentication information passes the verification, the access request will be considered as a valid request, and thenode will respond normally. If the verification fails, the node will reject the access and directly return 403.

Token Authentication URL Generation and Verification Tool
EdgeOne provides a generation tool and verification tool for Token authentication URLs. Developers can use this tool
to quickly and accurately generate and verify hotlink protection URLs that meet the requirements.

Directions
1. Log in to the EdgeOne console. In the left sidebar, click Site List. In the site list, click the site to be configured.
2. On the site details page, click Site Acceleration to go to the global site configuration page, and then click the RuleEngine tab.
3. On the rule engine management page, click Create Rule and select Add Blank Rule.

©2013-2022 Tencent Cloud. All rights reserved.

Page 8 of 245

Tencent Cloud EdgeOne

4. On the rule editing page, set the matching conditions that trigger this rule.
5. Click Action > Select Box, and select Token Authentication in the pop-up action list. The parameter
configuration instructions are as follows:
Parameter

Description

MethodCurrently, 5 authentication signature calculation methods are supported. Choose
the appropriate method based on the access URL format. For details, refer to theauthentication method.

Primary key (required)Primary password, consisting of 6-40 uppercase and lowercase English letters or
numbers.

Secondary key(optional)

Secondary password, consisting of 6-40 uppercase and lowercase English lettersor numbers.

Authentication
encryption string

Authentication parameter name, the value corresponding to which will be verified by
the node. It should contain 1-100 characters, including uppercase and lowercase
letters, numbers and underscores.
The validity period of the authentication URL (1-630720000 seconds). It determines

Validity period

whether a client request is valid:
If the current time is after the ''timestamp + validity period'' time, it indicates that therequest has expired, and 403 will be returned directly.
If the current time is before the ''timestamp + validity period'' time, it indicates thatthe request has not expired, and the md5 string will continue to be verified.

Notes
1. After the request passes the authentication, the node will automatically ignore the authentication-related parametersin the URL to improve the cache hit rate and reduce the amount of origin-pull.
2. The URL cannot contain any Chinese character.

©2013-2022 Tencent Cloud. All rights reserved.

Page 9 of 245

Tencent Cloud EdgeOne

Authentication Method A：

Last updated 2024-08-14 19:04:36

Format of Authentication URL

http://Hostname/Filename?sign=timestamp-rand-uid-md5hash©2013-2022 Tencent Cloud. All rights reserved.

Page 10 of 245

Tencent Cloud EdgeOne

Description of Authentication Fields
Field

Description

Hostname

Site acceleration domain name.

Path

Resource access path, which must start with / during authentication.

sign

User-defined authentication parameter name.

timestamp

rand
uid

Positive decimal integer Unix timestamp (the total number of seconds that have passed since
00:00:00, 1970.1.1 (UTC time), regardless of the time zone)
A random string consisting of 0-100 characters, including uppercase and lowercase letters andnumbers.
User ID, which is currently unused and is 0 by default.
A string containing 32 characters calculated based on the MD5 algorithm:

md5hashAlgorithm: MD5 (Path-timestamp-rand-uid-key).
Authentication logic: If the request has not expired, the node will compare this string value withthe md5hash value carried in the request URL. If the values are the same, the request willpass the authentication, and a response will be made to the request; if the values are different,
the authentication will fail, and 403 will be returned.

Configuration Example
Assuming authentication method A is used for the requested URL https://www.example.com/foo.jpg , theconfiguration is as follows:

Getting Authentication Parameters
Path: /foo.jpg .

©2013-2022 Tencent Cloud. All rights reserved.

Page 11 of 245

Tencent Cloud EdgeOne

timestamp: The time when the server generates the authentication URL is 15:27:17, July 15, 2024 (UTC+8), thedecimal (Unix timestamp) value of which is 1721028437 .
rand: The random number generated is Kv4cPTAAP5YTi .
uid: 0 .
Key: DvYmqE81E1F9R791H6lmht .
md5hash: MD5 (Path-timestamp-rand-uid-key)= MD5( /foo.jpg - 1721028437 - Kv4cPTAAP5YTi - 0 - 3C9mxSGzc8ZadmGNzE ) =0fbdca749d7ab784750685347e42075c .
Authentication URL Generated by a Client Request
https://www.example.com/foo.jpg?sign=1721028437-Kv4cPTAAP5YTi-00fbdca749d7ab784750685347e42075c .
Node Authentication
When the node server receives a client request via the encrypted URL, it will parse the timestamp parameter in the
URL, and compare the sum of it and the configured validity period of ''1 second'' with the current time:
1. If the current time is after the ''timestamp + validity period'' time, it indicates that the request has expired, and 403
will be returned directly. If the current time is before the ''timestamp + validity period'' time, it indicates that the request
has not expired, and the node server will go to step 2.
2. The node server calculates the md5hash value based on the obtained authentication parameters and compares itwith the md5hash value carried in the request URL. If the values are the same, the request will pass theauthentication, and a response will be made to the request; if the values are different, the authentication will fail, and403 will be returned.

©2013-2022 Tencent Cloud. All rights reserved.

Page 12 of 245

Tencent Cloud EdgeOne

Authentication Method B：

Last updated 2024-08-14 19:04:36

Format of Authentication URL

http://Hostname/timestamp/md5hash/Filename©2013-2022 Tencent Cloud. All rights reserved.

Page 13 of 245

Tencent Cloud EdgeOne

Parameter Description
Field

Description

Hostname

Site acceleration domain name.

Path

Resource access path, which must start with / during authentication.

timestamp

UTC+8 time in the format of YYYYMMDDHHMM, e.g., 201807301000.
A string containing 32 characters calculated based on the MD5 algorithm:
Algorithm: MD5 (key + timestamp + Path).

md5hashAuthentication logic: If the request has not expired, the node will compare this string value withthe md5hash value carried in the request URL. If the values are the same, the request willpass the authentication, and a response will be made to the request; if the values are different,
the authentication will fail, and 403 will be returned.

Configuration Example
Assuming authentication method B is used for the requested URL https://www.example.com/foo.jpg , theconfiguration is as follows:

Getting Authentication Parameters
Path: /foo.jpg .
timestamp: The time when the server generates the authentication URL is 15:33:50, July 15, 2024 (UTC+8), thedecimal (YYYYMMDDHHmm) value of which is 202407151533 .
Key: DvYmqE81E1F9R791H6lmht .
md5hash: MD5 (key + timestamp + Path) = MD5 ( DvYmqE81E1F9R791H6lmht202407151533/foo.jpg ) =d1f0b51c6894231fc12e054fcc7f0b3e .

©2013-2022 Tencent Cloud. All rights reserved.

Page 14 of 245

Tencent Cloud EdgeOne

Authentication URL Generated by a Client Request
https://www.example.com/202407151533/d1f0b51c6894231fc12e054fcc7f0b3e/foo.jpg .
Node Authentication
When the node server receives a client request via the encrypted URL, it will parse the timestamp parameter in the
URL, and compare the sum of it and the configured validity period of ''1 second'' with the current time:
1. If the current time is after the ''timestamp + validity period'' time, it indicates that the request has expired, and 403
will be returned directly. If the current time is before the ''timestamp + validity period'' time, it indicates that the request
has not expired, and the node server will go to step 2.
2. The node server calculates the md5hash value based on the obtained authentication parameters and compares itwith the md5hash value carried in the request URL. If the values are the same, the request will pass theauthentication, and a response will be made to the request; if the values are different, the authentication will fail, and403 will be returned.

©2013-2022 Tencent Cloud. All rights reserved.

Page 15 of 245

Tencent Cloud EdgeOne

Authentication Method C：

Last updated 2024-08-14 19:04:36

Format of Authentication URL

http://Hostname/md5hash/timestamp/Filename©2013-2022 Tencent Cloud. All rights reserved.

Page 16 of 245

Tencent Cloud EdgeOne

Parameter Description
Field

Description

Hostname

Site acceleration domain name.

Path

Resource access path, which must start with / during authentication.

timestamp

A Unix timestamp in the hexadecimal format (the total number of seconds that have passed
since 00:00:00, January 1, 1970 regardless of the time zone)
A string containing 32 characters calculated based on the MD5 algorithm:
Algorithm: MD5 (key + Path + timestamp). Note: During calculation, the hexadecimal number
identifier 0x of the hexadecimal timestamp must be filtered out.

md5hashAuthentication logic: If the request has not expired, the node will compare this string value withthe md5hash value carried in the request URL. If the values are the same, the request willpass the authentication, and a response will be made to the request; if the values are different,
the authentication will fail, and 403 will be returned.

Configuration Example
Assuming authentication method C is used for the requested URL https://www.example.com/foo.jpg , theconfiguration is as follows:

Getting Authentication Parameters
Path: /foo.jpg .
timestamp: The time when the server generates the authentication URL is 15:43:06, July 15, 2024 (UTC+8), thehexadecimal (Unix timestamp) value of which is 6694d30a .
Key: DvYmqE81E1F9R791H6lmht .
md5hash: MD5 (key + Path + timestamp) = MD5 ( DvYmqE81E1F9R791H6lmht/foo.jpg6694d30a ) =6688749e8906a726c12fe1be3aacd016 .
Authentication URL Generated by a Client Request©2013-2022 Tencent Cloud. All rights reserved.

Page 17 of 245

Tencent Cloud EdgeOne

https://www.example.com/6688749e8906a726c12fe1be3aacd016/6694d30a/foo.jpg .
Node Authentication
When the node server receives a client request via the encrypted URL, it will parse the timestamp parameter in the
URL, and compare the sum of it and the configured validity period of ''1 second'' with the current time:
1. If the current time is after the ''timestamp + validity period'' time, it indicates that the request has expired, and 403
will be returned directly. If the current time is before the ''timestamp + validity period'' time, it indicates that the request
has not expired, and the node server will go to step 2.
2. The node server calculates the md5hash value based on the obtained authentication parameters and compares itwith the md5hash value carried in the request URL. If the values are the same, the request will pass theauthentication, and a response will be made to the request; if the values are different, the authentication will fail, and403 will be returned.

©2013-2022 Tencent Cloud. All rights reserved.

Page 18 of 245

Tencent Cloud EdgeOne

Authentication Method D：

Last updated 2024-08-14 19:04:36

Format of Authentication URL

http://Hostname/Filename?sign=md5hash&t=timestamp©2013-2022 Tencent Cloud. All rights reserved.

Page 19 of 245

Tencent Cloud EdgeOne

Parameter Description
Field

Description

Hostname

Site acceleration domain name.

Path

Resource access path, which must start with / during authentication.

sign

User-defined authentication parameter name.

tUser-defined timestamp parameter nameTimestamp parameter.
Format: Positive decimal integer Unix timestamp, which is the total number of seconds that havetimestamppassed since 00:00:00, 1970.1.1 (UTC time) and is regardless of the time zone; or positive
hexadecimal integer Unix timestamp, which is the total number of seconds that have passed
since 00:00:00, 1970.1.1 (UTC time) and is regardless of the time zone.
A string containing 32 characters calculated based on the MD5 algorithm:

md5hashAlgorithm: MD5 (key + Path + timestamp). Note: During calculation, the hexadecimal number
identifier 0x of the hexadecimal timestamp must be filtered out.
Authentication logic: If the request has not expired, the node will compare this string value withthe md5hash value carried in the request URL. If the values are the same, the request willpass the authentication, and a response will be made to the request; if the values are different,
the authentication will fail, and 403 will be returned.

Configuration Example
Assuming authentication method D is used for the requested URL https://www.example.com/foo.jpg , theconfiguration is as follows:

Getting Authentication Parameters
Path: /foo.jpg .

©2013-2022 Tencent Cloud. All rights reserved.

Page 20 of 245

Tencent Cloud EdgeOne

timestamp: The time when the server generates the authentication URL is 15:51:47, July 15, 2024 (UTC+8), thedecimal (Unix timestamp) value of which is 1721029907 .
Key: DvYmqE81E1F9R791H6lmht .
md5hash: MD5 (key + Path + timestamp) = MD5 ( DvYmqE81E1F9R791H6lmht/foo.jpg1721029907 ) =cadcec4a04e67b9c2abf4b61c642a0dd .
Authentication URL Generated by a Client Request
https://www.example.com/foo.jpg?sign=cadcec4a04e67b9c2abf4b61c642a0dd&t=1721029907 .
Node Authentication
When the node server receives a client request via the encrypted URL, it will parse the timestamp parameter in the
URL, and compare the sum of it and the configured validity period of ''1 second'' with the current time:
1. If the current time is after the ''timestamp + validity period'' time, it indicates that the request has expired, and 403
will be returned directly. If the current time is before the ''timestamp + validity period'' time, it indicates that the request
has not expired, and the node server will go to step 2.
2. The node server calculates the md5hash value based on the obtained authentication parameters and compares itwith the md5hash value carried in the request URL. If the values are the same, the request will pass theauthentication, and a response will be made to the request; if the values are different, the authentication will fail, and403 will be returned.

©2013-2022 Tencent Cloud. All rights reserved.

Page 21 of 245

Tencent Cloud EdgeOne

Authentication Method V：

Last updated 2024-08-14 19:04:36

Overview
In order to enhance permission control for video scenarios, EO has launched a solution to TypeV authentication. The
features of this solution are as follows:
It supports specifying an expiration time in the URL, which cannot be used for a long time after being obtained byothers;It supports including a client IP in the signature calculation in the URL, which cannot be used after being obtained byothers;It supports specifying the preview duration in the URL to realize the preview feature;
It supports specifying a Referer blocklist/allowlist in the URL;
It supports specifying in the URL the start of video playback from a Unix timestamp to realize the pseudo-live
streaming feature;
Developers use a KEY to sign the URL and include the signature in the URL. As long as a user's key is not leaked,
other users cannot forge the encrypted URL;
The EdgeOne node checks the parameters and signature in the encrypted URL to control access requests. If arequest fails to pass the check, a 403 response code will be returned.

Authentication Parameters
The following are the meaning and value description of each parameter in the authentication URL.
Parameter
name

Required

Description

Yes

The key filled in when TypeV authentication is enabled. It should contain 8-20
characters, including uppercase and lowercase letters (a-Z), numbers (0-9), andspecial characters. The random generation of it on the console is supported.

Path

Yes

The Path part of the original URL. If the original URL is
http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4, the Path is/dir1/dir2/myVideo.mp4.

t

Yes

KEY

The expiration timestamp (in seconds) of the URL accessed, expressed in thelowercase hexadecimal format of Unix time.
Once expiration, the URL will no longer be valid, and a 403 response code will be
returned. Considering the possible time difference between machines, the actual©2013-2022 Tencent Cloud. All rights reserved.

Page 22 of 245

Tencent Cloud EdgeOne

expiration time of the authentication URL is generally 5 minutes longer than thespecified expiration time, that is, an additional tolerance time of 300 seconds is
given.
It is recommended that the expiration timestamp should not be too short, in orderto ensure that users can complete downloads or video playback within the validity
period.

exper

NoPreview duration in seconds, expressed in the decimal format. If the value isempty or 0, it means no preview (i.e., the full video is returned).
The preview duration should not exceed the original video duration, as this may
cause playback failures.
Link identifier, used to randomize an authentication URL and enhance theusNouniqueness of the link.
It is recommended to specify a random 'us' value each time an authentication
URL is generated.
This parameter is in seconds, and is expressed in the lowercase hexadecimalformat of Unix time. It enables the start of video playback from a specified time to

plive

No

realize the pseudo-live streaming feature.
Example: If the value of plive is 669f9b40, it means that the resources
corresponding to the encrypted request can be accessed only after 20:00:00,
July 23, 2024.
List of allowed domain names, which contain 1 to 10 items and are separated by

whref

No

half-width commas. No protocol name (http:// or https://) should be added to thebeginning of a domain name. The domain name is in the form of exact match (forexample, if abc.com is filled in, only abc.com can be matched and abc.com.cn
cannot be matched), and wildcards (such as *.abc.com) are supported.

bkref

No

List of forbidden domain names, which contain 1 to 10 items and are separated
by half-width commas. No protocol name (http:// or https://) should be added tothe beginning of a domain name. The domain name is in the form of exact match(for example, if abc.com is filled in, only abc.com can be matched andabc.com.cn cannot be matched), and wildcards (such as *.abc.com) aresupported.
List of allowed client IPs, which contain 1 to 10 items and are separated by half-

whip

No

width commas. Client IPs can be IPs or IP segments, such as 192.168.0.0 or
192.168.0.0/24. Among others, 0.0.0.0/0 represents all IPv4 addresses, and ::/0
represents all IPv6 addresses.
The client IP is obtained through the X-Forwarded-For header. If there are
multiple header values, the first one is taken.

bkip

No

The list of forbidden client IPs, which contain 1 to 10 items and are separated byhalf-width commas. Client IPs can be IPs or IP segments, such as 192.168.0.0 or©2013-2022 Tencent Cloud. All rights reserved.

Page 23 of 245

Tencent Cloud EdgeOne

192.168.0.0/24. Among others, 0.0.0.0/0 represents all IPv4 addresses, and ::/0
represents all IPv6 addresses.
The client IP is obtained through the X-Forwarded-For header. If there are
multiple header values, the first one is taken.
Hotlink protection signature, represented by a 40-character hexadecimal number.
sign

Yes

It is used to verify the validity of the authentication URL. If the signature
verification fails, a 403 response code will be returned. For the calculation
method, refer to the signature calculation formula.

Note:
For the VOD origin server, all the above parameters are supported. For non-VOD origin servers, the us andplive parameters are not supported.

Signature Calculation Formula©2013-2022 Tencent Cloud. All rights reserved.

Page 24 of 245

Tencent Cloud EdgeOne

sign = sha1(KEY + Path + t + plive + exper + us + whref + bkref + whip + bkip)
In the formula, + represents string concatenation, and optional parameters can be an empty string.

URL Generation Rules for Hotlink Protection
At the end of the original URL, hotlink protection parameters are added in the form of QueryString, as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 25 of 245

Tencent Cloud EdgeOne

http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=[t]&exper=[exper]&us=[us]&Note:
In the formula, + represents string concatenation, and optional parameters can be an empty string;
In the signature calculation, each parameter must strictly follow the order in the signature calculation formula. If theorder is incorrect, an erroneous signature will be generated.

Configuration Examples©2013-2022 Tencent Cloud. All rights reserved.

Page 26 of 245

Tencent Cloud EdgeOne

Assume the original URL is http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4 . The
developer has configured TypeV authentication, the generated Key is 24FEQmTzro4V5u3D5epW and thegenerated random string is 72d4cd1101 . Below are scenarios for ''validity time control of video playback URL'',''the same authentication URL allowing access by only one client IP'' and ''allowed video playback by client IP'', which
describe how to generate an authentication URL.

Example 1: Validity Time Control of Video Playback URL
If you need to generate an authentication URL for this video with an expiration time of 20:00:00, January 31, 2018
(Unix time: 1517400000), refer to the steps below.
Step 1: Determining Authentication Parameters
Parameter
name

Value

Description

KEY

24FEQmTzro4V5u3D5epW

The key selected by the developer in enabling key hotlink
protection

Dir/dir1/dir2/myVideo.mp4

The Path part of the original URLt

5a71afc0

The hexadecimal representation of the expiration timestamp
1517400000

us

72d4cd1101

A random string generated

Step 2: Calculating the Signature©2013-2022 Tencent Cloud. All rights reserved.

Page 27 of 245

Tencent Cloud EdgeOne

sign = sha1(''24FEQmTzro4V5u3D5epW/dir1/dir2/myVideo.mp45a71afc072d4cd1101'') = ''3

Step 3: Generating Authentication URL
The authentication parameters are concatenated into the original video URL's QueryString to get a video
authentication URL:

©2013-2022 Tencent Cloud. All rights reserved.

Page 28 of 245

Tencent Cloud EdgeOne

http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&us=72d4cd1101&sig

Example 2: The Same Authentication URL Allowing Access by Only One Client IP
If the same authentication URL requires access by only one client IP, refer to the steps below.
Step 1: Determining Authentication Parameters
Parameter
name

Value

©2013-2022 Tencent Cloud. All rights reserved.

Description

Page 29 of 245

Tencent Cloud EdgeOne

KEY

24FEQmTzro4V5u3D5epW

The key selected by the developer in enabling key hotlink
protectionPath/dir1/dir2/myVideo.mp4

The Path part of the original URLt

5a71afc0us

72d4cd1101

A random string generated

whip

192.168.0.0

Allowed client IP

The hexadecimal representation of the expiration timestamp
1517400000

Step 2: Calculating the Signature©2013-2022 Tencent Cloud. All rights reserved.

Page 30 of 245

Tencent Cloud EdgeOne

sign = sha1(''24FEQmTzro4V5u3D5epW/dir1/dir2/5a71afc072d4cd1101192.168.0.0'') = ''c

Step 3: Generating Authentication URL
The authentication parameters are concatenated into the original video URL's QueryString to get a video
authentication URL:

©2013-2022 Tencent Cloud. All rights reserved.

Page 31 of 245

Tencent Cloud EdgeOne

http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&us=72d4cd1101&whi

Example 3: Control of Allowed Playback Duration
If you need to generate a preview URL, with the preview duration being the first 5 minutes of the video (when theoriginal video duration is greater than 5 minutes), refer to the steps below.
Step 1: Determining Authentication Parameters
Parameter

Value©2013-2022 Tencent Cloud. All rights reserved.

Description

Page 32 of 245

Tencent Cloud EdgeOne

name
KEY

24FEQmTzro4V5u3D5epW

The key selected by the developer in enabling key hotlink
protectionPath/dir1/dir2/myVideo.mp4

The Path part of the original URLt

5a71afc0

The hexadecimal representation of the expiration timestamp
1517400000

exper

300

A preview of the first 5 minutes, i.e. 300 seconds

us72d4cd1101

A random string generated

Step 2: Calculating the Signature©2013-2022 Tencent Cloud. All rights reserved.

Page 33 of 245

Tencent Cloud EdgeOne

sign = sha1(''24FEQmTzro4V5u3D5epW/dir1/dir2/myVideo.mp45a71afc030072d4cd1101'') =Step 3: Generating Authentication URL
The authentication parameters are concatenated into the original video URL's QueryString to get a video
authentication URL:

©2013-2022 Tencent Cloud. All rights reserved.

Page 34 of 245

Tencent Cloud EdgeOne

http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&exper=300&us=72d4©2013-2022 Tencent Cloud. All rights reserved.

Page 35 of 245

Tencent Cloud EdgeOne

Smart Acceleration：

Last updated 2023-08-24 09:44:29

Function Introduction
When your site provides dynamic content services or mixed dynamic and static content, the user's request for
dynamic content needs an origin-pull request to respond to different resource content according to the user. At thistime, due to the differences in the region and operator of the client, the network environment is complex and intricate.
When accessing across regions and operators, it may cause slow access requests, high packet loss rates, and othersituations for users.
Smart acceleration can adjust and optimize network paths in real-time. After enabling this function, EdgeOne willdetect node network latency in real-time, select the best access path through intelligent algorithms, and dynamicallyadjust resource allocation and utilization according to the real-time network conditions, to help improve user
experience and ensure business continuity.

Billing Description
This function is a value-added service. After enabling smart acceleration, the upstream traffic of client users andEdgeOne nodes will be included in the security acceleration traffic fee based on the original billing items, and valueadded service fees will be charged according to the number of business requests. For details, please refer to theBilling Overview.

Scenario 1: Enable smart acceleration for all domain names of thesite
If your site is all mixed dynamic and static resources or pure dynamic resources, you need to enable smart
acceleration for the whole connected site. Please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. On the site details page, click Site Acceleration > Smart Acceleration to enter the smart acceleration details
page.
3. Find the smart acceleration configuration card, which is off by default. Click the switch to configure on/off.

©2013-2022 Tencent Cloud. All rights reserved.

Page 36 of 245

Tencent Cloud EdgeOne

Scenario 2: Enable smart acceleration for specified domain names
If only a certain domain name under your site is pure dynamic resources or mixed dynamic and static resources, youneed to enable smart acceleration separately for the specified domain name. Please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site.
2. On the site details page, click Rule Engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page.
4. On the rule editing page, select the Host matching type to match the requests of the specified domain name.
5. Click Operation > Select Box, and in the pop-up operation list, select the operation as smart acceleration, andclick the switch to turn on/off.

6. Click Save and Publish to complete the rule configuration.

Related Reference
What are static resources and what are dynamic resources?

©2013-2022 Tencent Cloud. All rights reserved.

Page 37 of 245

Tencent Cloud EdgeOne

Static resources: When a user accesses a resource multiple times, the same content is returned. For example:
images, videos, software installation packages, compressed files, CSS, JavaScript files, and other content that does
not change frequently.
Dynamic resources: When a user accesses a resource multiple times, different content is returned. That is, content
that needs real-time updates, user interaction, and other dynamic content. For example: API interfaces, jsp ,asp , php , perl , and cgi format files, etc.

©2013-2022 Tencent Cloud. All rights reserved.

Page 38 of 245

Tencent Cloud EdgeOne

Cache Configuration
Overview：

Last updated 2023-09-14 10:46:04
After your site is connected to EdgeOne, EdgeOne edge nodes will decide whether to cache the resource files of theclient request response based on the cache configuration rules. After the edge node caches the file, when other users
initiate the same file request, it can be directly responded by the EdgeOne edge node, effectively avoiding the long linkorigin-pull situation and responding to the latest file request at a faster speed.
You can customize your site cache according to the following usage scenarios:
Rule Type

CustomEdgeOne nodecaching rules

Usage Scenario

Function

There are various types of file resources under the site/domain, and itis necessary to customize the caching time of various resources in thenode to ensure that users access the latest files while reducing theorigin-pull request volume;

EdgeOne Node
Cache TTL﻿The site/domain contains dynamic resources, and it is necessary to
avoid caching the content of these resources.
When requesting the same path file, different URLs carry different
parameters, request headers, etc., which will point to different files;
When requesting the same path file, the parameters, request headers,etc. carried by the URL do not affect the file version and need to point
to the same cache file.

Custom Cache
Key﻿

When the origin response is abnormal, it is necessary to protect theorigin from further damage while normally responding to customer
requests.

Status codecaching TTL﻿
Offline Caching﻿Control
browsercaching

To further improve the web page loading speed and reduce traffic
consumption, allow the browser to cache static resources files for acertain period of time.

Browser Cache
TTL﻿

Clear thecache

When the cached files in the node have expired or illegal resources arecached, clear the cached resources in the node.

Cache Purge﻿

URL PreWarming

When the domain access is just completed or the files are updated, it
is necessary to cache the files in advance to the EdgeOne node to
improve the acceleration effect and reduce the origin-pull volume
during peak periods.

URL PreWarming﻿

ache control
when origin
response
exception©2013-2022 Tencent Cloud. All rights reserved.

Page 39 of 245

Tencent Cloud EdgeOne

Cache Prefresh

For files with continuous user access, it is necessary to ensure that thefiles have continuous cache in the node to avoid concentrated originpull after the cache expires. The cache pre-refresh can be used toverify the validity of the files and refresh the cache time.

Cache Prefresh﻿If you need to learn more about cache rules, you can refer to the following:
Learn about EdgeOne's content caching rules﻿
Learn about the role of Cache Key﻿
Learn about the role of Vary feature﻿©2013-2022 Tencent Cloud. All rights reserved.

Page 40 of 245

Tencent Cloud EdgeOne

EdgeOne Cache Rules
Content Cache Rules：

Last updated 2023-05-25 15:19:39

Overview
After a client initiates an HTTP request to an EdgeOne node, if the requested file is not found in the cache, EdgeOne
initiates a request to the origin to obtain the latest version of the file. After the origin returns the requested file,
EdgeOne caches the file based on the default cache policy and your custom rules (See Node Cache TTL. Cache rules
take effect in the following order:Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 41 of 245

Tencent Cloud EdgeOne

A cache rule takes effect only if the origin returns 200 or 206. If the origin returns 404, the node caches the status codefor 10s, and other status codes are not cached.
1. Rules configured in the rule engine are first matches the file against the cache rules in the rule engine from top tobottom. If the file matches a cache rule in the rule engine, it is cached as per that rule.
2. If the file does not match any rule in the rule engine, it is cached as per the global cache policy specified in Site
Acceleration. EdgeOne uses the global cache policy as the default cache policy. You can modify the default cachepolicy as needed.

Cache Rules
EdgeOne supports the following three types of cache policies:
Default cache policy: The default cache policy of EdgeOne. The default cache policy determines the cache time of afile on a node based on the Cache-Control header and other caching-related headers of the HTTP response.
No-cache policy: Rules are set in the rule engine to specify not to cache specified files or not to cache any files of thesite. A no-cache policy is applicable to dynamic or frequently updated files.
Custom cache policy: A custom cache policy allows you to cache files for a custom period of time.
Note:
EdgeOne supports cold file eviction. If a file cached in an EdgeOne node has not been requested over a long period oftime, EdgeOne may remove it from the node cache before the specified cache time expires.

Default cache policy
The following figure describes the default cache policy of EdgeOne:©2013-2022 Tencent Cloud. All rights reserved.

Page 42 of 245

Tencent Cloud EdgeOne

The default cache policy allows an EdgeOne node to control the caching of the file based on the following cache rules:
1. When the HTTP response contains any of the following not-to-cache headers, the file is not cached:
Cache-Control:private
Cache-Control:no-store
Cache-Control:no-cache
2. When the HTTP response header contains any of the following to-cache headers, the file is cached for the period oftime specified in the header:
Cache-Control:s-maxage
Cache-Control:max-age
Expires©2013-2022 Tencent Cloud. All rights reserved.

Page 43 of 245

Tencent Cloud EdgeOne

If more than one of the preceding response headers exists at the same time, their precedence is as follows: s-maxage> max-age > Expires. The file is cached for the period of time specified by the header with the highest priority.
3. When the HTTP response does not contain any of the preceding caching-related headers, the caching action
specified in the rule is performed:
Default cache policy:
If the HTTP response contains the Last-Modified header, the cache time is calculated by this formula: (Current
time - Value of Last-Modified ) × 0.1. If the result ranges from 10 to 3,600 seconds, the result is taken as thecache time. If the result is less than 10 seconds, 10 seconds is taken as the cache time. If the result is greater than
3,600 seconds, 3,600 seconds is taken as the cache time.
If the HTTP response does not contain the Last-Modified header, the cache time of a file is determined basedon the default cache rules and the file extension. The following table describes the cache time of files with different
extensions:
Table 1: Default cache time for different file types
File Type

Extension

Dynamic files

php, aspx, asp, jsp, do, dwr, cgi, fcgi, action, ashx, axd, andjson

Staticfiles

Imagesjpg, png, jpeg, webp, gif, heif, heic, kpg, and ico

Audio/Video

mp4, mp3, m3u8, ts, m4a, avi, m4s, and ogg

Webpages

html, js, and css

Packageszip, 7z, tar, br, gz, rar, and bz2

Documents

doc, docx, xls, xlsx, pdf, ppt, and pptx

Applications

apk, exe, and bin

Othersvsv, iso, jar, swf, chunk, and atlas

Cache Time
Do notcache thefile

2 hours

Do notOther files

N/Acache thefile

No Cache: If the HTTP response does not contain any of the preceding caching-related headers, the file is not cached.
Custom cache policy: If the HTTP response does not contain any of the preceding caching-related headers, the file iscached for the cache time specified in the custom rule.

No-cache policy©2013-2022 Tencent Cloud. All rights reserved.

Page 44 of 245

Tencent Cloud EdgeOne

If the no-cache policy is set for the EdgeOne rule engine or the entire site, the file is not cached regardless of whether
the HTTP response contains the Cache-Control header or other caching-related headers.

Custom cache policy

A custom cache policy allows you to cache a file for a custom period of time, and enable or disable the force cachefeature.
Enable force cache: Force cache is enabled by default. If force cache is enabled, EdgeOne caches the file for thecustom period of time, regardless of whether the HTTP response contains the Cache-Control header or othercaching-related headers.
Disable force cache: After you disable force cache, if the HTTP response contains any of the following not-to cacheheaders, the file is not cached:
Cache-Control:private
Cache-Control:no-store
Cache-Control:no-cache©2013-2022 Tencent Cloud. All rights reserved.

Page 45 of 245

Tencent Cloud EdgeOne

If the HTTP response does not contain any of the preceding headers, EdgeOne caches the file for the custom periodof time.

Learn More
Node Cache TTL
Cache Purge
URL Pre-Warming©2013-2022 Tencent Cloud. All rights reserved.

Page 46 of 245

Tencent Cloud EdgeOne

Cache Key Introduction：

Last updated 2023-08-07 16:30:58

What is Cache Key
Cache Key is used to determine whether the file resources accessed by users hit the edge caching content of
EdgeOne, and it is the unique identifier of cached resources within the node. Cache hits can help your site:
Reduce origin-pull requests and lower the bandwidth consumption of the origin.
Improve the access request speed of users.
The working principle of Cache Key is as follows:
When a file is cached in the EdgeOne edge node, the node will generate a corresponding Cache Key identifier for the
file according to the Cache Key rules. By default, the Cache Key is calculated based on the client request URL andquery string. When other clients initiate an HTTP request to the edge node, the node will compare the HTTP request
with the Cache Key of all cached resources in the node according to the Cache Key calculation rule. If they are
consistent, the corresponding cached resources will be directly responded to the client, which is a cache hit.

©2013-2022 Tencent Cloud. All rights reserved.

Page 47 of 245

Tencent Cloud EdgeOne

Cache Key's application scenarios
Cache Key is used for EdgeOne nodes to establish multi-version caching content for different versions of files. Even if
the client requests through the same path, the correct user file can be responded through the calculation rules ofCache Key.
You can understand how to correctly configure Cache Key to help you correctly match the requested cache files andreduce the origin-pull rate through the following scenario examples.
For example, User A and User B have the following requests:
Request A: https://www.example.com/Image/test.jpg?version=1&time=1651752743
Request B: https://www.example.com/Image/test.jpg?version=2&time=1651758319
Scenario 1: The file paths accessed by users are completely identical, but there are version differentiations according
to version parameter carried in the query string. The above requests are two different images. In this case,©2013-2022 Tencent Cloud. All rights reserved.

Page 48 of 245

Tencent Cloud EdgeOne

version parameter that affects the file version should be retained in the Cache Key to ensure that the node cancorrectly cache and respond to the corresponding file content.
Scenario 2: The content of the query string in the user's access URL does not affect the file content. The files
corresponding to the above requests are the same and do not affect the file version. In this case, all query strings
should be ignored in the Cache Key calculation to improve the hit rate of files in the node and reduce the origin-pull
requests.

Customizable Cache Key content and effective rules
EdgeOne allows users to customize Cache Key rules, supports configuring query strings, HTTP request headers, or
cookies to distinguish caches. You can learn how to configure custom Cache Key rules through Custom Cache Key.

：

Note

1. The calculation of Cache Key is based on the HTTP request content initiated by the client to the node. The origin
URL rewriting, origin follow redirect, origin HTTP request header, and Rewrite access URL do not affect thecalculation of Cache Key.
2. When Token authentication is configured in EdgeOne, the authentication content will not participate in the Cache
Key calculation.
3. When image processing parameters are enabled in EdgeOne, the image processing parameters carried in therequest will participate in the Cache Key calculation by default.

Query string
The query string refers to the string parameters after the " ? " in the request URL (including one or multiple
parameters, separated by " & "), for example,

color=blue&amp;size=large inhttps://www.example.com/images/example.jpg?color=blue&amp;size=large .

EdgeOne supports customizing the retention of specified query string content to distinguish caches.

：

Note

When retaining the query string as the Cache Key, if the position order of the parameters changes, the Cache Key will
also change.
For example, when clients initiate the following requests separately:
Request A: https://www.example.com/Image/test.jpg?version=1&type=aRequest B: https://www.example.com/Image/test.jpg?version=2&type=aRequest C: https://www.example.com/Image/test.jpg?type=a&version=1
Configuration

Cache behavior

Query string configuration is toretain all

The parameter content carried by Request A and Request B is different,
corresponding to different cache versions. The parameter content of©2013-2022 Tencent Cloud. All rights reserved.

Page 49 of 245

Tencent Cloud EdgeOne

Request A and Request C is consistent, but the order is different,
corresponding to different cache versions.
Query string configuration is toignore all

Requests A, B, and C all correspond to the same cache version.

Query string configuration is toretain the specified parameter
Type

The parameter order and content of Request A and Request B are
completely identical, corresponding to the same cache version; theparameter content of Request B and Request C is the same, but the orderis different, corresponding to different cache versions.

Query string configuration is toignore the specified parameter
Type

The remaining parameter content of Request A and Request B is notconsistent, corresponding to different cache versions; the remaining
parameter content of Request A and Request C is consistent, but the order
is not consistent, corresponding to different cache versions.

HTTP request header
EdgeOne supports adding specified HTTP request headers to the Cache Key calculation. EdgeOne edge nodes will
establish different cache versions based on the request header content. The order change of the request header does
not affect the calculation of the Cache Key.
For example, specify the HTTP request header User-Agent to be included in the Cache Key calculation. The
URL and parameter content of the following Request A and Request B are consistent, but the User-Agent header
content is not consistent, corresponding to different cache versions.
Request A: https://www.example.com/Image/test.jpg?version=1&type=a , with User-Agent:
chromeRequest B: https://www.example.com/Image/test.jpg?version=1&type=a , with User-Agent:
ios

CookieEdgeOne supports adding specified parameters in the Cookie to the Cache Key calculation, distinguishing cacheversions based on Cookie parameters and content. When multiple parameters in the Cookie participate in the Cache
Key calculation, the order change of the parameters does not affect the Cache Key calculation.
For example, specify the User parameter in the Cookie to be included in the Cache Key calculation. The parameter
content of the following Request A and Request B is the same, corresponding to the same cache, and the parameter
content of Request A and Request C is different, corresponding to different cache versions.
Request A: https://www.example.com/Image/test.jpg?version=1&type=a , with Cookie:
User=A;ID=1 .
Request B: https://www.example.com/Image/test.jpg?version=1&type=a , with Cookie:
User=A;ID=2 .

©2013-2022 Tencent Cloud. All rights reserved.

Page 50 of 245

Tencent Cloud EdgeOne

Request C: https://www.example.com/Image/test.jpg?version=1&type=a , with Cookie:
User=B;ID=1 .

Learn more
Learn about EdgeOne content caching rules﻿
How to configure custom Cache Key﻿How to configure node caching rules﻿
How to purge node cache resources﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 51 of 245

Tencent Cloud EdgeOne

Vary Feature：

Last updated 2023-05-09 10:47:25

Support for Vary
EdgeOne now fully supports the Vary feature by default. To use the feature, you can simply add a Vary header to the
response header in the origin response without any configuration. For more information about the standards of a Varyheader, see Vary.

What Is the Vary Feature?
Vary is an HTTP response header newly added in HTTP/1.1. When a client uses the same URL to initiates requests toan origin server, if the origin server has response files of different versions, requested resources may be cached by anintermediary cache system, such as the browser cache and content distribution network (CDN) cache, and the origin
server may fail to respond to requests by scenario. To prevent this condition, the origin server can use a Vary header
in the HTTP response to notify the intermediary cache system of the specific request header for distinguishing theversion of the cached content.
For example, if the client requests are all targeting at https://www.example.com/test.pdf , and the origin
server uses Vary: Accept-Language in the HTTP response header to distinguish the client language,
EdgeOne will generate caches of different versions based on the Accept-Language content specified in theclient requests.
When User A initiates a request with the URL https://www.example.com/test.pdf , and the request
contains the request header Accept-Language:zh-cn , EdgeOne responds to the request with File A.
When User B initiates a request with the URL https://www.example.com/test.pdf , and the request
contains the request header Accept-Language:en-US , EdgeOne responds to the request with File B.

©2013-2022 Tencent Cloud. All rights reserved.

Page 52 of 245

Tencent Cloud EdgeOne

Application Scenarios of Vary
You can flexibly use the Vary header to control the files requiring different cached file versions according to the HTTP
request header and solve issues in the following scenarios:

Scenario I: Distinguishing response files by client type when the request URLs are the same
When a website serves user access from both PCs and mobile devices at the same URL for user convenience, due tothe different screen resolutions between PCs and mobile devices, the frontend needs to adapt the image content tothe access source. In this case, the User-Agent header carried in the user requests is used to distinguish theaccess source type, ensuring requests from PCs are responded with Image A and requests from mobile devices are
responded with Image B. In this case, the origin server can add the Vary:User-Agent header to the responses
to instruct Edge nodes to distinguish the cached versions according to the User-Agent header in the user
requests.

©2013-2022 Tencent Cloud. All rights reserved.

Page 53 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 54 of 245

Tencent Cloud EdgeOne

Scenario II: Responding to cross-domain access according to the access source when therequest URLs are the same
When the same image file in a page cache is referenced by both Domain A and Domain B, to avoid cross-domain
errors, Access-Control-Allow-Origin is usually added to the response file in the origin server to allow crossdomain access. However, when the current file is cached, both cross-domain headers may be cached or a crossdomain access error may occur. In this case, the origin server can add the Vary:origin header to instruct Edge
nodes to distinguish the cached versions according to the Origin header in the user requests, while responding
the Access-Control-Allow-Origin cross-domain header.

©2013-2022 Tencent Cloud. All rights reserved.

Page 55 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 56 of 245

Tencent Cloud EdgeOne

Cache Configuration
Custom Cache Key：

Last updated 2024-05-31 15:43:47

Feature Introduction
When you need to point the Request URL of the same path to different files based on request parameters, cookies, or
HTTP request headers, or point the Request URL with different parameters to the same file, the custom Cache Key
supports customizing the Cache Key identification of resources in the node, including concatenating query strings,
concatenating HTTP headers or Cookie information, etc., so that the Request URL can correctly obtain thecorresponding cached resources according to different scenarios. You can learn what a Cache Key is through the
Cache Key Introduction.

Usage Scenarios
Scenario One: The file paths accessed by users are exactly the same, but there will be version differences based on
the carried query strings, HTTP request headers, and Cookie contents. The cache key of this type of file can be
adjusted by customizing the Cache Key.
Scenario Two: The content of the query string in the user's accessed URL does not affect the file content, and thefiles corresponding to the above requests are consistent and do not affect the file version. The cache key of this type offile can be adjusted by customizing the Cache Key.

Directions
Scenario One: Configure custom Cache Key for all domain names of the site
If you need to configure a custom Cache Key for the entire connected site, or as a site-level fallback configuration,please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.Directions.
2. On the site details page, click on Site Acceleration > Cache Configuration.

：

Note

Global configuration can only configure query strings and case-insensitive. For more comprehensive custom Cache
Key configuration options, please refer to the configuration steps in Scenario Two's rule engine.

©2013-2022 Tencent Cloud. All rights reserved.

Page 57 of 245

Tencent Cloud EdgeOne

On the cache configuration page, locate the Query string card and click Global settings to proceed with theconfiguration.

The default configuration is to retain all, that is, to retain all query parameters of the original Request URL as the
Cache Key. Other options are available: a. Ignore all: Ignore the entire query string; b. Reserve Specified Parameter:
Only retain the specified parameters in the query string; c. Ignore specified parameter: Only ignore the specified
parameters in the query string.

On the cache configuration page, find the Case-Insensitive Card. The default configuration is disabling the Ignore
case. Even if the URL's content is the same, but the letter case is different, it will be regarded as a different Cache
Key. Click the Global Enable switch to turn on the Ignore case, then different letter cases will be regarded as thesame Cache Key.

Scenario Two: Configure custom Cache Key for specific domain names, paths, or fileextensions, etc.
If you need to configure a custom Cache Key rule for the www.example.com domain under the site
example.com to ignore all query strings, concatenate the HTTP request header My-Client-Header , and©2013-2022 Tencent Cloud. All rights reserved.

Page 58 of 245

Tencent Cloud EdgeOne

use the parameters name1 and name2 in the Cookie as the Cache Key, you can refer to the following steps forconfiguration:
Directions
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page. On the rule editing
page, select Host as the matching type and configure it as www.example.com .
4. Click on the operation, and in the pop-up operation list, select the operation as Custom Cache Key;
5. Click on Add under the Type to add the custom Cache Key type. In this example scenario, add Query String, HTTP
Request Header, and Cookie for configuration and fill in the corresponding content. The complete rule configuration is
as follows:

6. Click Save and Publish to complete the rule configuration.

Effective Example
After the configuration is completed, the Cache Key is composed of URL+My-Client-Header+Cookie: Ignore all query
strings, concatenate My-Client-Header , and retain the specified parameters in the Cookie.
Then Client A request:
URL: https://www.example.com/path/demo.jpg?key1=value1&key2=value2
HTTP request header: Contains My-Client-Header:fruit
Cookie: name1=yummy;name2=tasty;name3=strawberry©2013-2022 Tencent Cloud. All rights reserved.

Page 59 of 245

Tencent Cloud EdgeOne

And Client B request:
URL: http://www.example.com/path/demo.JPG?key1=value1&key2=value2&key3=value3
HTTP request header: Contains My-Client-Header:fruit
Cookie: name1=yummy;name2=tasty;name3=blueberry
And Client C request:
URL: http://www.example.com/path/demo.JPG?
key1=value1&key2=value2&key3=value3&key4=value4
HTTP request header: Contains My-Client-Header:sea
Cookie: name1=yummy;name2=tasty;name3=fish
Requests A and B will hit the same cached resource, while C will hit another cached resource.

Related Reference
Description of supported header names:
HeaderType

Description

CustomHeaderCustom Headers.
Name: 1 - 100 characters, consisting of digits 0 - 9, letters a - z, A - Z, and the special character-.
Value: 1 - 1000 characters, Chinese is not supported.
Aggregated headers based on client User-Agent information:
Client Device Type: EO-Client-Device

PresetHeaderValues: Mobile , Desktop , SmartTV , Tablet , or Others
Client Operating System: EO-Client-OS
Values: Android , iOS , Windows , MacOS , Linux , or Others
Client Browser Type: EO-Client-Browser
Values: Chrome , Safari , Firefox , IE , or Others©2013-2022 Tencent Cloud. All rights reserved.

Page 60 of 245

Tencent Cloud EdgeOne

Node Cache TTL：

Last updated 2024-05-14 14:20:47

Feature Introduction
Node Cache TTL is used to determine whether resources are cached in EdgeOne nodes and the cache duration
within the nodes. When users request expired or uncached files, the node will not directly respond to the user's
request, but will go back to the origin to obtain the latest resources for response, and decide whether to cache them in
EdgeOne according to the cache rules. Caching files and allowing user requests to hit can help you:
Reduce the number of origin-pull requests and lower the bandwidth consumption of the origin.
Improve the speed of user access requests.
You can customize the cache time for different resources according to your business needs, optimize the cache
strategy for different resources, and improve the loading speed of requested resources. For more information on cache
instructions, please view EdgeOne Content Cache Rules.

：

Note

1. If the resources at the origin are updated and you need to update the node cache immediately, you can use theCache Purge function to actively purge the unexpired old cache, ensuring that subsequent requests can obtain thelatest resources from the origin.
2. Please do not cache dynamic resources in edge nodes to avoid users accessing incorrect content.
3. After the file is cached in the EdgeOne node, the platform has a hot and cold elimination mechanism. If the current
cached file has not been requested for a long time, it may be deleted from the node cache before the maximum cachetime is reached.

Directions
Scenario 1: Configure Node Cache TTL for all domain names of the site
If you need to configure the same Node Cache TTL for the entire connected site, or as a site-wide fallback
configuration, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure
within the site list.
2. On the site details page, click on Security Acceleration > Cache Configuration, find the EdgeOne Node Cache
TTL card.
3. Click on the Global settings to configure. For detailed configuration instructions, please refer to EdgeOne Content
Cache Rules.

©2013-2022 Tencent Cloud. All rights reserved.

Page 61 of 245

Tencent Cloud EdgeOne

Default configuration: Follow origin Cache-Control , and follow EdgeOne default cache policy when the origin has
no Cache-Control .

Scenario 2: Configure Node Cache TTL for specified domain names, paths, or fileextensions, etc.
If you need to configure different Node Cache TTLs for different domain names, paths, or file extensions, such as notcaching files with php/jsp/asp/aspx extensions under the www.example.com domain, and caching files
with jpg/png/gif/bmp/svg/webp extensions for 30 days, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure
within the site list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click on Create Rule to enter the new rule editing page.
4. On the rule editing page, first select the matching type as HOST, with the value of www.example.com as theoutermost matching condition, and click on Add IF.

5. In the newly added IF condition, select the matching type as File extension, add php/jsp/asp/aspx
extensions, click on the operation, and in the pop-up operation list, select the operation as Node Cache TTL, andconfigure it as uncached.
6. Repeat the above steps, add another IF condition, add jpg/png/gif/bmp/svg/webp extensions, andconfigure it as cached for 30 days.
7. After the configuration, the rule is as follows, click on Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 62 of 245

Tencent Cloud EdgeOne

Related Reference
How do I tell whether user access has hit the EdgeOne cache?﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 63 of 245

Tencent Cloud EdgeOne

Status Code Cache TTL：

Last updated 2023-08-08 10:47:23

Function Introduction
When EdgeOne retrieves resources from the origin, if the origin successfully responds with the resources, EdgeOne
will respond to the client request and cache it in EdgeOne for direct response next time. If the origin responds with an
exception status code such as 4xx or 5xx, EdgeOne cannot obtain the resources, and the next request will still triggera follow origin, which may put significant pressure on the origin. By configuring the status code cache TTL, EdgeOne
can directly respond with the exception status code within the cache time, instead of triggering a follow origin for all
requests, which can mitigate the pressure on the origin and improve the response speed.
Currently, the following status codes can be configured:
4xx: 400, 401, 403, 404, 405, 407, 414.
5xx: 500, 501, 502, 503, 504, 509, 514.

：

Note

EdgeOne caches the 404 status code by default for 10 seconds.

Directions
Scenario 1: Configure status code cache TTL for all domain names of a site
If you need to configure the status code cache TTL for the whole connected site, or as a fallback configuration for thesite level, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure
within the site list.
2. In the site details page, click on Security Acceleration > Cache Configuration, find the node cache TTL card.
3. In the rule engine management page, click on create rule to enter the new rule editing page. On the rule editing
page, select the matching type as All
4. Click on the operation, and in the pop-up operation list, select the operation as status code cache, and configure
the corresponding cache status code and cache time.

©2013-2022 Tencent Cloud. All rights reserved.

Page 64 of 245

Tencent Cloud EdgeOne

5. Click save and publish to complete the rule configuration.

Scenario 2: Configure status code cache TTL for specified domain names, paths, or fileextensions
If you need to configure different status code cache TTL for different domain names, paths, or file extensions, forexample, configure the status code cache TTL for the www.example.com domain under the example.com site, pleaserefer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure
within the site list.
2. In the site details page, click on the rule engine.
3. In the rule engine management page, click on create rule to enter the new rule editing page. On the rule editing
page, select Host as the matching type and configure it as www.example.com .
4. Click on the operation, and in the pop-up operation list, select the operation as status code cache, and configure
the corresponding cache status code and cache time.

©2013-2022 Tencent Cloud. All rights reserved.

Page 65 of 245

Tencent Cloud EdgeOne

5. Click save and publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 66 of 245

Tencent Cloud EdgeOne

Browser Cache TTL：

Last updated 2023-08-08 11:17:02

Feature Introduction
The Client browser cache TTL is the cache duration of resources in the browser, which by default follows the origin's
Cache-Control headers. You can control the cache duration of resources in the browser by configuring
EdgeOne's browser cache TTL without modifying the origin configuration.
EdgeOne implements browser cache TTL by setting the Cache-Control response headers when responding toclients. The following configurations are supported:
Follow Origin: Follow the origin's Cache-Control; if the origin does not have Cache-Control, no changes will be made;No Cache: Regardless of whether the origin carries Cache-Control, the browser will be controlled not to cache files;
Custom Time: Regardless of whether the origin carries Cache-Control, the max-age will be modified to the specified
cache time.
You can control the cache duration of resources in the browser by adjusting the browser cache TTL, optimizing thecache strategy for different resources, and improving the loading speed of requested resources.

Directions
Scenario One: Configure browser cache TTL for all domains of the site
If you need to configure the same browser cache TTL for the whole connected site, or as a site-wide fallback
configuration, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you need to configure
within the site list.
2. In the site details page, click on Security Acceleration > Cache Configuration, find the browser cache TTL card,and click on the site-wide settings to modify it.
3. In the cache configuration page, select the required site, click on site acceleration > cache configuration, findthe browser cache TTL card, and click on Global settings to modify.

©2013-2022 Tencent Cloud. All rights reserved.

Page 67 of 245

Tencent Cloud EdgeOne

Default Configuration: Supports following the origin's Cache-Control ; if the origin does not have CacheControl , no caching will be done.

Scenario Two: Configure browser cache TTL for specific domains, paths, or file extensions,etc.
If you need to configure different browser cache TTLs for different domains, paths, or file extensions, such as notcaching files with php/jsp/asp/aspx extensions for the www.example.com domain, and caching files with
jpg/png/gif/bmp/svg/webp extensions for 1 hour, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you need to configure
within the site list.
2. In the site details page, click on the rule engine.
3. In the rule engine management page, click on Create rule to enter the new rule editing page.
4. In the rule editing page, first select the matching type as HOST, with the value of www.example.com as theoutermost matching condition, and then click Add IF;

5. In the newly added IF condition, select the matching type as File extension, add php/jsp/asp/aspx
extensions, click on operation, and in the pop-up operation list, select the operation as browser cache TTL, andconfigure it as No Cache.
6. Repeat the above steps, add another IF condition, add jpg/png/gif/bmp/svg/webp extensions, andconfigure it as cache for 1 hour.
7. After the configuration, the rule is as follows, click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 68 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 69 of 245

Tencent Cloud EdgeOne

Offline Caching：

Last updated 2023-08-08 11:19:55

Function Introduction
By default, if EdgeOne cannot establish a connection with the origin when following the origin to obtain resources, itwill respond with an error code. After enabling offline caching, when EdgeOne cannot establish a connection with theorigin, it can use the resources cached in EdgeOne (even if the resources have expired) until the origin recovers theconnection. This can effectively ensure the availability and continuity of the business and improve the user experience.

：

Note

If there is no cache available in EdgeOne, it will respond with an error code.

Usage Scenarios
Unstable origin: If your origin server is prone to failures or instability, enabling offline caching can provide a better
user experience during origin failures. Even if the cached resources have expired, the service can still be provided tousers, avoiding the situation where users cannot access the site when the origin fails.
Critical business assurance: For some critical businesses, you may want to ensure that users can still access key
content on the website or application when the origin has issues. Enabling offline caching can ensure that users canstill access critical resources when the origin fails, ensuring business continuity.
Avoid sudden traffic impact: In some cases, the origin may be subject to sudden traffic surges, causing server
overload or crashes. Enabling offline caching can continue to provide services to users during origin failures, mitigate
the pressure on the origin, and help the origin recover to normal operation.

Directions
Scenario 1: Configure offline caching for all domain names of the site
If you need to enable/disable offline caching for the whole connected site, or as a site-level fallback configuration,please refer to the following steps:
1. Log in to the EdgeOne console, and in the left menu bar, click on the site list. In the site list, click on the site thatneeds to be configured.
2. On the site details page, click on Security Acceleration > Cache Configuration, find the offline cache card, andclick on the switch to enable it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 70 of 245

Tencent Cloud EdgeOne

Default state: Enabled. If disabled, when the origin fails, i.e., it cannot follow the origin to obtain resources normally,
the node will pass the origin response to the client request.

Scenario 2: Configure offline caching for specific domain names, paths, or file extensions,etc.
If you need to configure different offline caching for different domain names, paths, or file extensions, etc., for example,
enable offline caching for the www.example.com domain under the example.com site, please refer to the following
steps:
1. Log in to the EdgeOne console, and click on Site List in the left menu bar, then click on the site to be configured in
the Site List.
2. On the Site Details page, click on the Rule Engine.
3. On the Rule Engine Management page, click Create Rule to enter the editing page for the new rule. On the Rule
Editing page, select Host as the matching type and configure it as www.example.com .
4. Click on the operation, and in the pop-up operation list, select the operation as Offline Cache and turn on theswitch.

5. Click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 71 of 245

Tencent Cloud EdgeOne

Cache Prefresh：

Last updated 2023-08-08 14:47:25

Feature Introduction
After the cache resources expire within the EdgeOne node, EdgeOne will follow the origin to obtain the latest resource
files when receiving the corresponding client requests, which may cause a large increase in origin-pull requests during
peak periods. The cache pre-refresh function can verify the validity of cache resources before they expire, without
waiting for expiration, which helps maintain the real-time nature of resources and respond to requests more quickly.
The cache pre-refresh time can be configured according to the percentage of the file cache TTL.

Usage Scenarios
Since the cache pre-refresh function can verify the validity of resources in advance, it is suggested to use it inscenarios where content needs to be frequently updated or user experience is highly demanded:High Real-time Requirements: For content that needs to be updated quickly, such as news, event pages, etc.,
customers hope that users can obtain the latest resources when requesting. By enabling the cache pre-refresh
function, the node verifies and updates the cache before the resources expire, ensuring that users can obtain relatively
new resources when accessing, thus avoiding additional waiting time when users request and improving user
experience.
Reduce Origin-pull Pressure: For some hotspot resources, a large number of origin-pull requests may be triggered
after expiration. Enabling the cache pre-refresh function can advance these origin-pull requests, reducing theconcentration of a large number of origin-pull requests when resources expire, thereby reducing origin-pull pressure.

Directions
Scenario One: Configure cache pre-refresh for all domain names of the site
If you need to configure the same cache pre-refresh for the whole connected site, or as a site-level fallback
configuration, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the cache configuration page, select the required site, click Site Acceleration > Cache Configuration, andfind the cache pre-refresh configuration card.

©2013-2022 Tencent Cloud. All rights reserved.

Page 72 of 245

Tencent Cloud EdgeOne

Configuration state: Default is enabled, can be turned off by clicking the slider.
Pre-refresh Time: The percentage of the node cache TTL, can enter an integer between 1-99. Default is 90%.

Scenario Two: Configure cache pre-refresh for specific domain names, paths, or fileextensions, etc.
If you need to configure different cache pre-refresh for different domain names, paths, or file extensions, etc., forexample: Configure a more advanced pre-refresh time - 60% for the www.example.com domain under theexample.com site. Please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page. On the rule editing
page, select Host as the matching type and configure it as www.example.com .
4. Click on the operation, and in the pop-up operation list, select the operation as cache pre-refresh, and configure it
as 60% of the TTL.
5. The complete configuration is shown below, click Save and Publish to complete the rule configuration.

Attachment: Functional Principle©2013-2022 Tencent Cloud. All rights reserved.

Page 73 of 245

Tencent Cloud EdgeOne

Assuming that the specified image test.jpg has a node cache TTL of 10 seconds and a cache pre-refresh timeof 80% of the TTL (i.e., 8 seconds), then:
1. When the node receives the client request for the first time, the current node does not cache the file, and it will follow
the origin to pull the resource and cache it in the node, with a cache TTL of 10 seconds. Within 0-7 seconds, if theclient request is received again, the node will directly provide the resource from the cache and normally respond to theclient request;
2. When the test.jpg cached in the node reaches the pre-refresh time, between the 8th and 10th seconds, if theclient request is received, the node will still normally respond to the client request, but at the same time, it will
asynchronously follow the origin to verify whether the cache resource is valid;
If the resource is valid, the cache TTL of the resource on the node will be updated and reset to 10 seconds;
If the resource is invalid, the latest valid resource will be obtained from the origin to the node, and the node cache TTL
will be reset to 10 seconds;
3. If no client requests are received after the file exceeds the node cache TTL, the cache will exceed the cache.
4. When the node receives a Client request next time, the node will send an origin-pull request to the origin to verify
whether the resources are valid. If the file is updated, the latest file will be pulled, otherwise, the file will be cachedagain and the Cache time will be refreshed to 10 seconds.

©2013-2022 Tencent Cloud. All rights reserved.

Page 74 of 245

Tencent Cloud EdgeOne

Clear and Preheat Cach
Cache Purge：

Last updated 2024-03-21 09:29:50

Overview
When your resource content is cached to the EdgeOne edge node, during the cache validity period, users accessing
the resource will be directly responded by the EdgeOne edge node without triggering a return to the origin. If yourorigin site updates the resource content at this time, in order to prevent users from still accessing the old resource
files, you can manually clear the cached resources in all edge nodes by using the Cache Purge function. After thecache is cleared, when users access the resource, EdgeOne will follow the origin to obtain the latest resource forresponse.

Quota Description
Different billing plans have different quotas, please refer to: Comparison of EdgeOne Plans.

Use Cases
You may need to use this function in the following scenarios:
Content update: When you have updated some resources on the origin, but the cache on EdgeOne has not expired,
you may want to let the client user see the latest content immediately.
Error fix: If there are some erroneous contents cached on EdgeOne from your origin, to avoid business risks, youneed to purge these erroneous caches immediately to ensure that EdgeOne no longer provides the wrong content.
Testing and debugging: When developing and debugging a website, you may need to frequently modify and test
the content. To ensure that you see the latest modified content rather than the cached old version, you can use theclear the cache function.
Emergency response: In some emergency situations, such as being attacked or releasing sensitive information, youneed to remove the relevant content from EdgeOne immediately.
Cache Rules adjustment: When you adjust or optimize the EdgeOne Cache Rules, you may need to purge theexisting cache to ensure that the new Rules are Effective immediately.

Support Type©2013-2022 Tencent Cloud. All rights reserved.

Page 75 of 245

Tencent Cloud EdgeOne

EdgeOne clear the cache support based on various types of purging, details as follows:
Type
URL

Directory

Details
Match the node cache resources of the URL, for example,
https://www.example.com/path/foo.jpg .
Match the node cache resources of the directory, for example,
https://www.example.com/path/.
Match the node cache resources of the Hostname, for example, www.example.com . Do not

Hostname

support submitting URLs in the format of *.test.com , that is, the domain name cannot
contain wildcards, and the corresponding subdomains need to be specified.
Purge the cache by matching the tag value (tags) in the Cache-Tag response header of the
HTTP response packet, for example, Cache-Tag: tag1,tag2,tag3 .
Only applicable to the Enterprise plan.
EdgeOne supports identifying the Cache-Tag in the origin response headers, please add

Cache-Tagtag(s) to this header:
The maximum header size is 6KB.
Multiple tags are separated by ",", a single tag does not exceed 128 characters, and the tag
limitation is 1,000.
Tags are case-insensitive, that is, Tag1 and tag1 will be recognized as the same tag.

All Cache

All cache resources of the site on the node.
If a wildcard domain name (e.g., *.foo.example.com ) is connected to the current site
( example.com ), it is unable to take effect against all caches under the wildcard domainname. You need to submit separate tasks to clear the cache for each specific subdomain.

EdgeOne Cache Purge is divided into direct deletion and mark as expired methods, as follows:
URL Type and Cache-Tag Type are set to "directly delete" by default, which means directly deleting the cache
content. When a user sends a request for resources, EdgeOne will immediately origin-pull the latest resources,
increasing the number of origin-pull requests within a short time and weakening the acceleration effect. If a large
amount of content is submitted, the origin will be under greater pressure.
Other purge types are set to "mark as expired" by default, which means that the cache will not be directly deleted, butmarked as expired. If the cache node has Last-Modified and Etag headers, the next time a user requests theresource, the node will carry If-None-Match and If-Modified-Since headers for origin-pull verification
whether the resource has been updated. The response of 304 or 200 is determined by the origin, generally speaking:If there is no update - the origin returns 304 (Not Modified), then the node continues to use the cache to respond,
effectively saving bandwidth;
If there is an update - the origin returns 200 (OK), then the node collects the latest resources from the origin andcompares the Last-Modified and Content-Length headers of the cached resources and the new resources. If
either header value is different, the new resource will overwrite the expired cache on the node.

©2013-2022 Tencent Cloud. All rights reserved.

Page 76 of 245

Tencent Cloud EdgeOne

Note:
EdgeOne nodes differentiate cache based on the URL before and after encoding by default. Therefore, when
refreshing, you need to submit them separately. If the URL contains special characters, then when submitting the URL
refresh in the console:
https://example.com/d/default_avatar.png?x-oss-process=image/resize,w_600,1_800, the cache corresponding to
the URL before encoding will be refreshed;https://example.com/d/default_avatar.png?x-oss-process=image%2Fresize%2Cw_600%2C1_800, the cachecorresponding to the URL after encoding will be refreshed.

Directions
Scenario One: Clear cache by entering content
If you have a small amount of content to clear and it is convenient to enter the content directly in the input box, you canfollow these steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configurein the site list.
2. In the site details page, click on Site Acceleration > Cache Purge.
3. On the Cache Purge page, select the resource type you want to clear, enter the corresponding resource content,
and click OK.

4. Switch to the History Records tab to view the history records of the specified time range (within the last month) and
purge type.

Scenario Two: Clear cache by uploading a file for batch import
If you have a large amount of content to clear or have already placed the content in a file, you can choose to upload
the file:©2013-2022 Tencent Cloud. All rights reserved.

Page 77 of 245

Tencent Cloud EdgeOne

1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configurein the site list.
2. In the site details page, click on Site Acceleration > Cache Purge.
3. On the Cache Purge page, select the resource type you want to clear, choose the "Upload File" method, upload thefile, and click OK.

4. Switch to the History Records tab to view the history records of the specified time range (within the last month) and
purge type.

Related References
How long does it take for cache purge and cache pre-warming to take effect after submitting content?﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 78 of 245

Tencent Cloud EdgeOne

URL Pre-Warming：

Last updated 2023-12-18 15:26:16

Function Introduction
When a business releases new resources, the client's first request for these resources may encounter a situation
where there is no cache on EdgeOne, resulting in an inability to respond immediately and the need to follow the origin
to obtain. The cache pre-warming function allows resources to be cached on EdgeOne in advance. In this way, even if
the client requests for the first time, it can be directly responded from the cache of EdgeOne without the need to follow
the origin. The implementation of cache pre-warming is to submit the URLs that need to be pre-warmed, and thencache the resources that match these URLs from the origin to EdgeOne in advance, thereby improving theacceleration effect and mitigating the pressure on the origin.

Quota Description
Different billing plans have different quotas, please refer to: Comparison of EdgeOne Plans.

Usage Scenarios
You may need to use this function in the following scenarios:
Newly released content: When your business releases new content or updates existing content, you want to ensurethat this content is immediately available on EdgeOne, so that client users can access the latest content for the firsttime, reducing the delay when accessing for the first time. For example, before the game business officially releases a
new version of the installation package or upgrade package, the installation package resources can be preheated to
EdgeOne. After the official release, users can directly obtain the installation package resources from the node whenrequesting to download these installation packages, improving the download speed.
Large-scale event operations: Before large-scale events, you want to ensure that the key resources of the event
have been cached on EdgeOne, which helps to ensure that when the event starts, client users can quickly access therequired content, reducing the delay and congestion caused by high traffic.
Expected traffic peaks: If you expect a significant increase in website traffic during a specific period (e.g., holiday
promotions, news releases, etc.), you can use the cache pre-warming function to ensure that key resources havealready been cached on the edge nodes. This helps to disperse the pressure of origin-pull requests during peak
periods and improve the access speed of client users.

：

Note

©2013-2022 Tencent Cloud. All rights reserved.

Page 79 of 245

Tencent Cloud EdgeOne

When preheating resources, simulated requests will be made to retrieve the corresponding resources from the origin.
If there are many preheating tasks submitted, more origin-pull requests will be generated, and the bandwidth of theorigin will increase.
If the preheated resources conflict with the node cache, that is, if EdgeOne has cached identical resources and they
have not expired, they will still be valid and will not be overwritten by the preheated resources. If the identicalresources have changed, you can purge the corresponding node cache before preheating.

Directions
Scenario One: Preheat cache by inputting content
If you have less content to preheat and it is convenient to input the content directly in the input box, please follow thesteps below:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site that needs to be
configured in the site list.
2. In the site details page, click Site Acceleration > Cache Pre-Warming.
3. On the Cache Pre-Warming page, enter the corresponding resource content and click OK.
4. Switch to the History Record tab to view the history records within a specified time range (within one month).

Scenario Two: Batch import preheating cache content by uploading files
If you have more content to preheat or have already placed the content in a file, you can choose to upload the file:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site that needs to be
configured in the site list.
2. In the site details page, click Site Acceleration > Cache Pre-Warming.
3. On the Cache Pre-Warming page, select the "Upload File" method and upload the file, then click Confirm
Preheating.

©2013-2022 Tencent Cloud. All rights reserved.

Page 80 of 245

Tencent Cloud EdgeOne

4. Switch to the History Record tab to view the history records within a specified time range (within one month).

Related References
How long does it take for cache purge and cache pre-warming to take effect after submitting content?﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 81 of 245

Tencent Cloud EdgeOne

How to improve the Cache Hit Rate of
EdgeOne：Last updated 2024-07-01 09:40:56
This article introduces how to reasonably use various configurations on EdgeOne, combined with your actual businessscenarios for tuning, and improve the cache hit rate of files within the site.

Background introduction
When your site is connected to EdgeOne and acceleration is enabled, when users access static resources such asimages and videos, EdgeOne will cache the corresponding static files in the edge nodes. When other users initiate
repeated requests, the edge nodes will directly respond to the requests, avoiding origin-pull requests.
If the cache hit rate is too low, it will cause a large number of user requests to go back to the origin, which will bring a
lot of processing pressure to the origin site, reduce the user's access experience, and the site acceleration effect. You
can optimize and improve the cache hit rate through the following configuration tuning.

：

Note

If you need to view the current cache hit analysis, you can view it on the console through Data Analysis > Cache
Analysis. For details, please refer to Cache Analysis.

Optimization methods
1. Adjust the node cache TTL configuration
The configuration of the node cache TTL will directly affect whether EdgeOne caches the specified file resources andthe corresponding cache time. If the file caching strategy is not cached or the cache time on the node is short, it willcause users to access without hitting the cache, frequently going back to the origin, and reducing the accessexperience.
By default, EdgeOne has enabled default caching rules for global sites. You can view the EdgeOne content cachingrules to understand how EdgeOne's caching rules take effect. In order to improve the cache hit rate, it isrecommended that you configure caching rules separately in the rule engine based on file extensions.
Suggested configuration
It is recommended that you configure personalized caching rules for different file types in different scenarios:©2013-2022 Tencent Cloud. All rights reserved.

Page 82 of 245

Tencent Cloud EdgeOne

1. Files that are not updated frequently, such as download resources, video files, etc., it is recommended to configurea custom cache time on EdgeOne, with a cache time of 30 days or longer, and force caching through EdgeOne nodes;
common download resources and video file formats are as follows:
Audio and video

mp4;mp3;ts;m4a;avi;m4s;ogg;mkv;mov;flv;rm;rmvb;swf;wav;wmv;rmi;aac

Compressedpackagerar;7z;zip;gzip;dmg;gz;ios;tar;jar;br;bz2

Document

doc;docx;xls;xlsx;pdf;ppt;pptx

Application

apk;exe;bin

Othersvsv;iso;jar;swf;chunk;atlas

2. Frequently updated file content, such as image content, if the cache time is too long, it may cause users to accessexpired content due to cache hits. Therefore, it is recommended to configure a custom cache time on EdgeOne, with ageneral cache time configured according to business needs, which can be set between 1-7 days. Common image
content formats are as follows:
Imagesjpg;png;jpeg;webp;gif;heif;heic;kpg;ico

Web pages

html;htm;shtml;hml;js

3. Dynamic files, such as php, json files, etc., if cached, will cause users to access content that cannot be correctly
responded to. Therefore, it is recommended to configure them separately on EdgeOne as not cached. Common
dynamic file formats are as follows:
Dynamic
resources

php;aspx;asp;jsp;do;dwr;cgi;fcgi;action;ashx;axd;json

Optimization example
When you view the resource hit rate in the cache analysis, you can view the specific file extensions on the right to see
which types of resources have a large number of misses. For example, in the current cache distribution, there aremany .mp4 format files that have not hit the cache.
If you follow EdgeOne's default caching rules completely, the problem is that the response file failed to respond to the
Cache-Control header. According to the default caching rules, the .mp4 file has a cache time of 2 hours on thenode. Because the cache time is short, this file will frequently go back to the origin. If you need to cache this file, you
can go to the rule engine, add a new rule, set the node cache TTL to custom cache for 30 days when the file extension
is equal to mp4, and enable forced caching, that is, ignoring the CC header of the origin response, and the node
forcibly caches the file. For detailed operation steps, please refer to: Node cache TTL.

©2013-2022 Tencent Cloud. All rights reserved.

Page 83 of 245

Tencent Cloud EdgeOne

2. Customize the cache key Cache Key to point the same type of request to a cache file
By default, EdgeOne will generate a unique identifier for the cache key based on the user's access Request URL andquery string, which serves as the cache key for the file. When there are the same requests, the edge node willcompare whether the request is consistent with the cache key in the cache to determine whether the cache is hit. If the
URL carries dynamic parameter content that does not affect the file version, such as user identification ID, multiple
caches will be established based on the different parameters, resulting in a decrease in cache hit rate. You can
optimize this by customizing the cache key Cache Key.
Suggested configuration
When some parameters in the request URL do not affect the file version, it is recommended to improve the cache hit
rate by retaining or ignoring the specified parameter content.
Optimization example
The current request URL is: https://image.example.com/test.jpg?
version=1.1&token=1234567890 , where the parameter version=1.1 will affect the content of the image,and token=1234567890 will not affect it. To improve the hit rate of the cache, you can ignore the token parameterin the custom Cache Key. For detailed operations, please refer to: Custom Cache Key.

©2013-2022 Tencent Cloud. All rights reserved.

Page 84 of 245

Tencent Cloud EdgeOne

3. URL Pre-Warming
URL Pre-Warming allows EdgeOne to cache files to edge nodes in advance. When users access the files, they candirectly hit the cache, reducing the concurrent follow origin for the first time and improving the cache hit rate. When you
add a new site to EdgeOne or release new popular resources, it is suggested to pre-warm the cache in advance. For
detailed operations, please refer to: URL Pre-Warming.

4. Enable Cache Pre-Refresh
If your files are mainly popular files, and you need to ensure that the files can continuously have cache in the node, you
can enable cache pre-refresh. Before the cache of the file in the node expires, when a user requests a file in the node,
it will verify with the origin whether the file has been updated. If not, the cache time of the file in the node will be
refreshed. For detailed operations, please refer to: Cache Pre-Refresh.

5. Make Reasonable Use of Vary Mechanism
When the origin responds with a Vary header, the CDN will cache the content based on the specified content in the
Vary header. For a detailed explanation of the Vary principle, please see the Vary feature. If the current file does notneed to be controlled by the Vary header to cache different versions, it is suggested that you avoid responding to thisheader in the origin response to reduce the number of cache versions created and improve the cache hit rate.

Learn more
How to determine whether a user's request hits the EdgeOne node cache﻿©2013-2022 Tencent Cloud. All rights reserved.

Page 85 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 86 of 245

Tencent Cloud EdgeOne

File Optimization
Smart Compression：

Last updated 2023-10-11 10:19:42

Function Introduction
EdgeOne enables Gzip or Brotli compression globally by default. When the client request header carries AcceptEncoding: br, gzip or Accept-Encoding: br or Accept-Encoding: gzip , the node will
intelligently compress files based on their Content-Type . Compressed files can effectively reduce the size ofresources and speed up content transmission. Enabling smart compression can help you:
1. Improve user experience: By reducing resource size, web page loading speed can be significantly improved,
providing a better user experience. Especially for websites with a large amount of CSS, JavaScript, and otherresources, enabling compression can greatly reduce loading time.
2. Save traffic: Compressed resources will consume less network traffic, which will help reduce operational costs.

Directions

：

Note

By default, you do not need to modify this configuration. If in some scenarios, such as: the current client will perform
MD5 verification on the file or the current client does not support parsing the specified compressed file, and you want
the current site to use only Brotli compression or Gzip compression, or not to compress at all, you can follow the steps
below.

Scenario 1: Enable/Disable Smart Compression for All Domain Names of the Site
If you need to enable/disable smart compression for the whole connected site, please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. On the site details page, click Site Acceleration > File Optimization to enter the network optimization details
page.
3. Find the smart compression configuration card, which is enabled by default. Click the switch to configure
enable/disable.

©2013-2022 Tencent Cloud. All rights reserved.

Page 87 of 245

Tencent Cloud EdgeOne

Scenario 2: Enable/Disable Smart Compression for Specific Domain Names
If you only need to enable/disable smart compression for specific domain names, please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site.
2. On the site details page, click Rule Engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page.
4. On the rule editing page, select the Host matching type to match requests for specific domain names.
5. Click Operation > Select Box, and in the pop-up operation list, select the operation as Smart Compression, andclick the switch to enable/disable Gzip or Brotli compression.

6. Click Save and Publish to complete the rule configuration.

Related References
Smart Compression Effective Rules。

1. Smart compression supports file size range:256B - 30MB

2. Smart compression is synchronous compression, compressing files while fetching them from the origin. When thenode first requests a compressed file, it can directly respond with the compressed file.
3. Smart compression compresses files based on Content-Type by default, supporting the following types:©2013-2022 Tencent Cloud. All rights reserved.

Page 88 of 245

Tencent Cloud EdgeOne

text/html
text/xml
text/plain
text/css
text/javascript
application/json
application/javascript
application/x-javascript
application/rss+xml
application/xmltext
image/svg+xml©2013-2022 Tencent Cloud. All rights reserved.

Page 89 of 245

Tencent Cloud EdgeOne

image/tiff
text/richtext
text/x-script
text/x-component
text/x-java-source
text/x-markdown
text/js
image/x-icon
image/vnd.microsoft.icon
application/x-perl
application/x-httpd-cgi
application/xml
application/xml+rss
application/vnd.api+json
application/x-protobuf
multipart/bag
multipart/mixed
application/xhtml+xml
font/ttf
font/otf
font/x-woff
application/vnd.ms-fontobject
application/ttf
application/x-ttf
application/otf
application/x-otf
application/truetypeapplication/opentype
application/x-opentype
application/font-woff
application/eot
application/font
application/font-sfnt
application/wasm
application/javascript-binast
application/manifest+json
application/ld+json
4. If you have both Gzip and Brotli compression enabled at the same time, and the client request header AcceptEncoding carries both br and gzip:
If the node already has cached content, it will respond according to the following rules:
If the node has both Brotli and gzip compressed cache content, it will prioritize responding with Brotli compression.
If the node only has Brotli compressed cache content, it will prioritize responding with Brotli compression.
If the node only has gzip compressed cache content, it will prioritize responding with Gzip compression.
If the node does not have cached content, it will prioritize responding with Brotli compression.

©2013-2022 Tencent Cloud. All rights reserved.

Page 90 of 245

Tencent Cloud EdgeOne

5. When only Brotli compression is enabled, if the request compression header is gzip, the compression will not takeeffect, and the original resources will be returned; when only Gzip compression is enabled, if the request compression
header is br, the compression will not take effect, and the original resources will be returned.
6. If the origin server has enabled compression and the server carries response headers: Content-Encoding ,the smart compression function will no longer be effective.

Request Example
Not Enabled Smart Compression
First request for gzip compressed file, not hit node cache, fetch the original file from the origin and cache it to the node,
EdgeOne responds with the original file:

Enabled Smart Compression
First request for gzip compressed file, not hit node cache, fetch the file from the origin, node synchronously
compresses and caches the compressed file, EdgeOne responds with the compressed file:
Smart compression supports streaming compression, and if the request does not hit the node cache, it will respond ina chunked manner after fetching the file from the origin.

©2013-2022 Tencent Cloud. All rights reserved.

Page 91 of 245

Tencent Cloud EdgeOne

Subsequent requests, hit the node cache of gzip compressed file, the node directly responds with the compressed file.

©2013-2022 Tencent Cloud. All rights reserved.

Page 92 of 245

Tencent Cloud EdgeOne

Media processing
Image Processing：

Last updated 2023-12-18 09:50:36

Image Processing
Image processing is to resize and convert images. The process of processing, caching and responding is taken place
on EdgeOne servers. Your own origin only needs to store the original images, thus reducing image management costs
on your side. EdgeOne can also compress images to improve page load speed without sacrificing visual impact.

Supported Image Processing Capability
ResizeCapability

Parameter
Name

（

）

Description： w/100

Specify width, height： h/100

Specify height, width
adaptive

Parameter Value type/pixel

w/<Width> ,for example

h/<Height> ,for example

Resizeeo-img.resize

w/<Width>/h/<Height> ,for

： w/100/h/100

adaptive

Specify width and height

example： l/100

Specify long side, shortside adaptive： s/100

Specify short side, longside adaptivel/<Long> ,for example

s/<Short> ,for example

Format Conversion
Support converting the original image to the specified format by carrying the specified parameter
Capability

Parameter
Name

Supported Input Formats

Formateo-

Static image jpg png bmp©2013-2022 Tencent Cloud. All rights reserved.

： 、 、 、

Supported Output Formats： 、 、 、 、 、All static jpg png bmp jp2 jxr

Page 93 of 245

Tencent Cloud EdgeOne

Conversion

img.format

、 、 、

、 、

jp2 jxr gif webp avif heif

： 、、Dynamic image gif webp
avif heif、、 、 、Static：jpg、png、bmp、jp2、jxr（takethe first frame of gif animation as a single
static image）
Dynamic：gif、webp、avif、heif
gif heif webp avif

Limitations
The original image size for processing should not exceed 32MB.
The width and height of the input original image should not exceed 30,000 pixels, and the total pixels should notexceed 250 million pixels; for dynamic images, the width x height x frame count of the original image should notexceed 250 million pixels.
The input gif format animation frame count should not exceed 300 frames.
The width and height settings of the output image should not exceed 9999 pixels.
Note
Any of the following situations may cause the image processing to fail and return the original image:
1. If any parameter of the original image and the result image for image processing exceeds the above limits, we will
not be able to process the image and can only respond with the original image.
2. If incorrect request parameters are entered, the image will not be processed and will be returned directly as theoriginal image, such as the following situations:Duplicate input parameters: eo-img.resize=w/100&eo-img.resize=w/200 , which will be considered asillegal parameter passing;pelling error: any format error or spelling error parameter, such as eo-img.resize=w=100 , will be considered
as illegal parameter passing;
Resize parameter error: the parameters w/ (width) and h/ (height) should not be mixed with s/ (shortside) and l/ (long side). For example, w/300/s/200 is illegal parameter passing, and the image will remainunchanged.
3. If the image scaling function is turned off within the console, all eo-img related parameters will be treated as normal
query strings and will not trigger the image processing function.
4. If other exceptions occur that prevent normal image processing, we will prioritize providing the original image, andin subsequent requests, we will automatically try to reprocess the image.

Pricing
This feature is billed based on the number of image resizing requests. For more information, see VAU Fee (Pay-asYou-Go).
Note©2013-2022 Tencent Cloud. All rights reserved.

Page 94 of 245

Tencent Cloud EdgeOne

This feature is in the free trial period now.

Directions
You can add image processing parameters to the client request URL to resize images.
If you don’t want to change the original client request URL, please try edge functions. See Converting Images with
Edge Functions.

Adding Image Processing Parameters to the Client Request URL
You can add image processing parameters to the client request URL to resize images.
1. Log in to the EdgeOne console. click on the site list in the left menu bar, click on the site to be configured in thesite list, and enter the site details page.
2. On the site details page, click Site Acceleration > Media Processing on the left sidebar.
3. On the page that appears, toggle Image Resize on.

4. After enabled, you only need to pass the image scaling demand by concatenating the eo-img related parameter tothe Request URL in the Client requests. EdgeOne will automatically complete the image processing based on theimage processing parameter in the Request URL. For example: https://www.example.com/foo.png?eoimg.resize=w/100。

Image Processing Example
In the following examples, the original image is 500 × 280 pixels in resolution and 500 KB in size.
1. Resize the image width to 200 pixels and scale the height automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=w/200©2013-2022 Tencent Cloud. All rights reserved.

Page 95 of 245

Tencent Cloud EdgeOne

2. Resize the image height to 200 pixels and scale the width automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=h/200

3. To resize the image width to 300 pixels and the height to 200 pixels:
Request URL: http://www.example.com/foo.png?eo-img.resize=w/300/h/200
ImportantIf both the width and height are specified, the aspect ratio of the original image may not be retained.

©2013-2022 Tencent Cloud. All rights reserved.

Page 96 of 245

Tencent Cloud EdgeOne

4. Resize the long side to 400 pixels and scale the short side automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=l/400

5. Resize the short side to 200 pixels and scale the long side automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=s/200©2013-2022 Tencent Cloud. All rights reserved.

Page 97 of 245

Tencent Cloud EdgeOne

6. Convert the image format to WebP:
Request URL: http://www.example.com/foo.png?eo-img.format=webp
Output image format: WebP
7. Resize the width to 200 pixels, scale the height automatically, and convert the format to WebP.
Request URL: http://www.example.com/foo.png?eo-img.resize=w/200&eo-img.format=webp©2013-2022 Tencent Cloud. All rights reserved.

Page 98 of 245

Tencent Cloud EdgeOne

Network Optimization
HTTP/2：

Last updated 2024-01-02 10:05:11

What is HTTP/2?
EdgeOne supports clients to initiate requests using the HTTP/2 protocol. HTTP/2 (i.e., HTTP 2.0, the second versionof the Hypertext Transfer Protocol) is the second major version of the HTTP protocol, which can effectively reduce
network latency and improve site page loading speed.

：

Note

1. If the client request does not use HTTP/2, EdgeOne is compatible with HTTP 1.x protocol access.
2. For configuring access requests, please refer to this document. If you need to configure HTTP/2 to follow the origin,please refer to HTTP/2 origin-pull.
3. Starting from November 23, 2023, for security reasons (for details, see Protection against DDoS attacks targeting
HTTP/2 protocol vulnerabilities), the HTTP/2 will be disabled by default for incremental sites, and users may enable itas needed.

Prerequisites
The access domain name of the current site has been configured with an SSL certificate. For how to configure an SSL
certificate, please refer to: Certificate Configuration.

Directions
Scenario 1: Modify HTTP/2 support for all domain names of the site
If you need to enable or disable HTTP/2 for the whole connected site, please follow the steps below:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. On the site details page, click Security Acceleration > Network Optimization to enter the network optimization
details page.
3. Locate the HTTP/2 configuration card, which is enable by default. Click the switch to enable/disable.

©2013-2022 Tencent Cloud. All rights reserved.

Page 99 of 245

Tencent Cloud EdgeOne

Scenario 2: Enable HTTP/2 for a specified domain name
If you only need to enable or disable HTTP/2 for a specified domain name, please follow the steps below:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site.
2. On the site details page, click Rule Engine.
3. On the rule engine management page, click Create Rule to enter the editing page of the new rule.
4. On the rule editing page, select the Host matching type to match requests for the specified domain name.
5. Click Operation > Select box, and in the pop-up operation list, select the operation as HTTP/2. Click the switch toenable/disable.

6. Click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 100 of 245

Tencent Cloud EdgeOne

HTTP/3(QUIC)Overview：

Last updated 2023-12-15 09:59:07

What is HTTP/3
HTTP/3 (HTTP over QUIC) is the next-generation Internet transmission protocol, designed to solve the head-of-line
blocking issues in HTTP/2. Instead of being based on TCP, HTTP/3 uses the QUIC protocol, which is based on the
UDP protocol. Compared to HTTP/1.1 and HTTP/2, HTTP/3 provides faster connection establishment and datatransmission speeds, supports multiplexing for simultaneous transmission of multiple requests and responses, andhas made improvements in areas such as congestion control, header compression, etc., significantly reducing latency
and waiting time, and improving website performance and user experience.

EdgeOne's support for HTTP/3
EdgeOne now supports both HTTP/3 and QUIC protocols, with the following versions of the QUIC protocol supported:
Standard（）
IETF QUIC（iQUIC）
Google QUIC gQUIC

Supported Versions、 、 、
draft-27、draft-29、RFC 9000﻿
Q039 Q043 Q046 Q050

How to use HTTP/3 or QUIC access in your App
If your users need to access through an App, the App needs to integrate support for HTTP/3 or QUIC protocols.
EdgeOne provides a QUIC SDK to help you quickly complete the integration. For details, please refer to the QUICSDK download and integration example.
If your site is mainly a website, and the user's current browser supports the QUIC protocol and has enabled QUIC
protocol access, your site only needs to enable HTTP/3 (QUIC) on EdgeOne to support it. You can check whether thecurrent browser supports HTTP/3 by viewing if the browser supports HTTP/3.﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 101 of 245

Tencent Cloud EdgeOne

Enable HTTP/3：

Last updated 2023-12-18 10:58:37
This article introduces how to enable support for the HTTP/3 protocol within the EdgeOne platform.

：

Note

1. If you need to enable HTTP/3 support, the current access domain must have an HTTPS certificate configured totake effect.
2. If both HTTP/2 and HTTP/3 are enabled at the same time, the actual client requests will use either HTTP/2 or
HTTP/3 based on the client's request.

Billing Instructions
HTTP/3 is a billed feature, and the specific fee standard can be referred to: VAU Fee (Pay-as-You-Go).﻿

Scenario 1: Enable support for the HTTP/3 protocol for all domainnames of the site
If you need to enable support for the HTTP/3 protocol for all domain names, please follow the steps below:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. In the site details page, click Site Acceleration > Network Optimization to enter the network optimization details
page.
3. Click the "switch" of the HTTP/3 module to enable or disable the HTTP/3 function.

Off state (default): does not support HTTP/3 requests.
Activated state: supports HTTP/3 requests and uses HTTP/3 to accelerate site requests.

©2013-2022 Tencent Cloud. All rights reserved.

Page 102 of 245

Tencent Cloud EdgeOne

Scenario 2: Enable support for the HTTP/3 protocol for specified
domain names
If you need to enable support for the HTTP/3 protocol for different domain names, please follow the steps below:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the site to be configured.
2. In the site details page, click Rule Engine.
3. In the rule engine management page, click Create Rule to enter the new rule editing page.
4. In the rule editing page, select the Host matching type to match requests for specified domain names.
5. Click Operation > Selection Box, and in the pop-up operation list, select the operation as HTTP/3, and switch theswitch to On.

6. Click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 103 of 245

Tencent Cloud EdgeOne

QUIC SDKSDK Overview：

Last updated 2023-06-29 11:21:46
Tencent Cloud EdgeOne QUIC SDK is a QUIC-based development toolkit that provides easy-to-use APIs fordevelopers to integrate QUIC into their applications more quickly, enabling stable, high-quality network transfer.
Supported platforms include Android and iOS.

About QUICQUIC (Quick UDP Internet Connections) is a new general-purpose, secure, and multiplexing transport layer network
protocol. The standard HTTP/3 protocol is implemented based on QUIC, which supports 0-RTT connections, nonHOL blocking multiplexing and easy implementation of user-mode congestion control to transfer more data with alower bandwidth, enabling high-quality data transfer even under poor network conditions with a high packet loss rate
and network latency. It also supports connection migration that can guarantee an uninterrupted connection even if the
network of a mobile device is switched frequently.

Must-Knows
EdgeOne QUIC SDK is free of charge during beta testing.

Supported Versions
EdgeOne QUIC SDK supports IETF QUIC and Google QUIC. See below for details:
Standard

Supported Version

Google QUIC (gQUIC)

QO43, Q046, Q050, Q051

IETF QUIC (iQUIC)

draft-29, RFC 9000

©2013-2022 Tencent Cloud. All rights reserved.

Page 104 of 245

Tencent Cloud EdgeOne

SDK Download and Integration：

Last updated 2024-05-08 21:35:03

Downloading SDK
Tencent Cloud EdgeOne QUIC SDK supports iOS and Android operating systems.

Android Download ZIP

iOS Download ZIP

Directions
Access Android SDK
Access iOS SDK
1. Environment requirements:
Android Studio 2.0+
Android 5.0 (SDK API level 21) or above
2. Download TQUIC_Android_SDK.zip and compress the package. Copy the AAR file to the project directory(app/libs).
3. Include sdk and okhttp dependencies in the build.gradle file.

©2013-2022 Tencent Cloud. All rights reserved.

Page 105 of 245

Tencent Cloud EdgeOne

dependencies {...
implementation fileTree(dir: 'libs', include: ['*.aar']) //Add the *.aar file.
implementation 'com.squareup.okhttp3:okhttp:3.11.0' //Add the okhttp dependenci}
4. Configure permissions in AndroidManifest.xml . The QUIC SDK requires the following permissions:©2013-2022 Tencent Cloud. All rights reserved.

Page 106 of 245

Tencent Cloud EdgeOne<uses-permission android:name="android.permission.INTERNET" />1. Environment requirements:
Xcode 10.0+
iPhone or iPad on iOS 10.0 or above
A valid developer signature for your project
2. Download TQUIC_iOS_SDK.zip and compress the package. Copy the framework file to the project
directory.

©2013-2022 Tencent Cloud. All rights reserved.

Page 107 of 245

Tencent Cloud EdgeOne

3. Import TQUICiOS.framework and Tquic.framework to XCode.
Note
Tquic.framework is a dynamic library and needs to be embedded and signed.
4. Add -ObjC, -l"c++” to the compilation option Other Linker Flags.

©2013-2022 Tencent Cloud. All rights reserved.

Page 108 of 245

Tencent Cloud EdgeOne

Sample CodeAndroid：

Last updated 2023-06-29 11:20:56
The following code shows how to make QUIC requests with the Android client. For details of the API description, seeAndroid APIs.

Creating GET Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 109 of 245

Tencent Cloud EdgeOne//Create QuicClient and initialize QUIC configuration. It is recommended to use Qui
QuicClient quicClient = new QuicClient.Builder().setCongestionType(QuicClient.CONGESTION_TYPE_BBR) //Use BB.setConnectTimeoutMillis(6 * 1000) //Configure connection.build();//Create QuicRequest and specify the request URL.
String url="";QuicRequest request = new QuicRequest.Builder(url).get().build();//Execute the request asynchronously and get the result. See %!s(<nil>) for instruc©2013-2022 Tencent Cloud. All rights reserved.

Page 110 of 245

Tencent Cloud EdgeOne

quicClient.newCall(request).enqueue(new QuicCallback() {@Override
public void onResponse(QuicCall call, QuicResponse response) throws IOException//When the request is executed successfully, it returns the response data
ResponseBody body = response.body();if(body != null) {String res = body.string();}}@Override
public void onFailed(QuicCall call, int errorCode, String error) {//When the request fails to be executed, it returns the error message.
}});

Creating POST Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 111 of 245

Tencent Cloud EdgeOne//Create QuicClient and initialize QUIC configuration. It is recommended to use Qui
QuicClient quicClient = new QuicClient.Builder().setCongestionType(QuicClient.CONGESTION_TYPE_BBR) //Use BB.setConnectTimeoutMillis(3 * 1000) //Configure connection.build();//Construct body data.
String body="your body string";
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), b//Create QuicRequest.

©2013-2022 Tencent Cloud. All rights reserved.

Page 112 of 245

Tencent Cloud EdgeOne

String url="";QuicRequest request = new QuicRequest.Builder(url).post(requestBody).build();//Execute the request asynchronously and get the result. See %!s(<nil>) for instrucquicClient.newCall(request).enqueue(new QuicCallback() {@Override
public void onResponse(QuicCall call, QuicResponse response) throws IOException//When the request is executed successfully, it returns the response data
ResponseBody body = response.body();if(body != null) {String res = body.string();}}@Override
public void onFailed(QuicCall call, int errorCode, String error) {//When the request fails to be executed, it returns the error message.
}});

Canceling Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 113 of 245

Tencent Cloud EdgeOne...
//Create QuicCall. See %!s(<nil>) for instructions.
QuicCall quicCall = quicClient.newCall(request);// Initiate a request.
...
//Cancel the request using the cancel method via QuicCall.
quicCall.cancel();©2013-2022 Tencent Cloud. All rights reserved.

Page 114 of 245

Tencent Cloud EdgeOne

iOS：

Last updated 2023-06-29 11:20:56
The following code shows how to create QUIC requests with the iOS client. For details of the API description, see iOS
APIs.

Creating GET Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 115 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 116 of 245

Tencent Cloud EdgeOne// Session configuration
TQUICURLSessionConfiguration *quicSessionConfiguration = [TQUICURLSessionConfigurat// Congestion control algorithm
quicSessionConfiguration.congestionType = TQUICCongestionTypeBBR;// Connection timeout
quicSessionConfiguration.connectTimeoutMillis = 6 * 1000;// Create SessionManager. See %!s(<nil>) for instructions.
TQUICHTTPSessionManager *quicSessionManager = [[TQUICHTTPSessionManager alloc] init// (Optional) Serialize via TQUICHTTPRequestSerializer/TQUICHTTPResponseSerializer.

©2013-2022 Tencent Cloud. All rights reserved.

Page 117 of 245

Tencent Cloud EdgeOne// Initiate a GET request.
[quicSessionManager GET:@"url"parameters:nil
headers:niltimeoutInterval:0
downloadProgress:nil
success:^(TQUICURLSessionTask * _Nonnull task, id _Nullable respon// When the request is executed successfully, it returns the response data.
// Get the response headers. Since this is an HTTP response, it can be conv
NSDictionary *headers = [(NSHTTPURLResponse *)task.response allHeaderFields// Get the response body.
id body = responseObject;}
failure:^(TQUICURLSessionTask * _Nullable task, NSError * _Nonnull e// When the request fails to be executed, it returns the error message.
NSInteger errorCode = error.code;}];

Creating POST Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 118 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 119 of 245

Tencent Cloud EdgeOne// Session configuration
TQUICURLSessionConfiguration *quicSessionConfiguration = [TQUICURLSessionConfigurat// Congestion control algorithm
quicSessionConfiguration.congestionType = TQUICCongestionTypeBBR;// Connection timeout
quicSessionConfiguration.connectTimeoutMillis = 6 * 1000;// Create SessionManager. See %!s(<nil>) for instructions.
TQUICHTTPSessionManager *quicSessionManager = [[TQUICHTTPSessionManager alloc] init// (Optional) Serialize via TQUICHTTPRequestSerializer/TQUICHTTPResponseSerializer.

©2013-2022 Tencent Cloud. All rights reserved.

Page 120 of 245

Tencent Cloud EdgeOne// Construct body data.
NSData *bodyData;// Initiate a POST request.
[quicSessionManager POST:@"url"body:bodyData
headers:niltimeoutInterval:timeInterval
uploadProgress:^(NSProgress * _Nonnull uploadProgress) {} success:^(TQUICURLSessionTask * _Nonnull task, id _Nullable// When the request is executed successfully, it returns the re// Get the response body.
id body = responseObject;} failure:^(TQUICURLSessionTask * _Nullable task, NSError * _No// When the request fails to be executed, it returns the error
NSInteger errorCode = error.code;}];

Canceling Requests©2013-2022 Tencent Cloud. All rights reserved.

Page 121 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 122 of 245

Tencent Cloud EdgeOne// Create SessionManager.
...
// Initiate a request via SessionDataTask. See %!s(<nil>) for instructions.
TQUICURLSessionDataTask *dataTask =[quicSessionManager dataTaskWithRequest:request
uploadProgress:nil
downloadProgress:nilcompletionHandler:^(NSURLResponse * _Nonnull response, id_// Run callback after the request has finished.

©2013-2022 Tencent Cloud. All rights reserved.

Page 123 of 245

Tencent Cloud EdgeOne}];//Send the request.
[dataTask resume];//Cancel the request.
[dataTask cancel];©2013-2022 Tencent Cloud. All rights reserved.

Page 124 of 245

Tencent Cloud EdgeOne

API Documentation
Android：

Last updated 2023-06-29 11:20:56

API Overview
API

Description

QuicClient﻿

The main function of QUIC, used to create QuicCall instances and QUIC
configuration and get the version number etc.

QuicCall﻿Manage QUIC requests.

QuicRequest﻿

Encapsulate requests.

QuicResponse﻿

Encapsulate responses.

QuicCallback﻿

Execute callbacks.

QuicNetStats﻿

Get information about QUIC network status.

QuicClient
The main function of QUIC, used to create QuicCall instances and QUIC configuration and get the version number
etc.
API

Description

newCall﻿Create a QuicCall instance.

Builder﻿Construct QUIC configuration .

getVersion﻿

Get the SDK version number.

newCall
Create a QuicCall instance for each QUIC request.

©2013-2022 Tencent Cloud. All rights reserved.

Page 125 of 245

Tencent Cloud EdgeOne

QuicCall newCall(QuicRequest request)
Parameter

Description

request

The request to be encapsulated. See QuicRequest.

getVersion
A static method that can get the SDK version number.

©2013-2022 Tencent Cloud. All rights reserved.

Page 126 of 245

Tencent Cloud EdgeOne

String getVersion()

Builder
QUIC configuration APIsAPI

Description

setQuicVersion﻿

Set the QUIC version.

setCongestionType﻿

Set the congestion control algorithm.

©2013-2022 Tencent Cloud. All rights reserved.

Page 127 of 245

Tencent Cloud EdgeOne

setConnectTimeoutMillis﻿

Set the connection timeout.

setTotalTimeoutMillis﻿

Set the total timeout for the request.

setIdleTimeoutMillis﻿

Set the idle connection timeout.

setSupportIpV6﻿

Whether to support IPv6.

build﻿Create QuicClient.

setQuicVersion
Set the QUIC version.

©2013-2022 Tencent Cloud. All rights reserved.

Page 128 of 245

Tencent Cloud EdgeOne

Builder setQuicVersion(int quicVersion)
Parameter

Description

quicVersion

Set the QUIC version.
Supported versions: Q043, Q046, Q050, Q051, draft-29, RFC-V1 (RFC 9000).
Values:
QuicClient.QUIC_VERSION_Q43 (default)
QuicClient.QUIC_VERSION_Q46 audio/video proxy
QuicClient.QUIC_VERSION_Q50 audio/video proxy©2013-2022 Tencent Cloud. All rights reserved.

Page 129 of 245

Tencent Cloud EdgeOne

QuicClient.QUIC_VERSION_Q51 audio/video proxy
QuicClient.QUIC_VERSION_IETF_DRAFT_29 audio/video proxy
QuicClient.QUIC_VERSION_IETF_RFC_V1 audio/video proxy

setCongestionType
Set the congestion control algorithm.

Builder setCongestionType(int congestionType)
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 130 of 245

Tencent Cloud EdgeOne

Supported congestion control algorithms: CubicBytes, RenoBytes, BBR, PCC,
GCC.

congestionType

Values:
QuicClient.CONGESTION_TYPE_BBR (default)
QuicClient.CONGESTION_TYPE_RENO_BYTES
QuicClient.CONGESTION_TYPE_BBR
QuicClient.CONGESTION_TYPE_PCC
QuicClient.CONGESTION_TYPE_GCC

setConnectTimeoutMillis
Set the connection timeout.

©2013-2022 Tencent Cloud. All rights reserved.

Page 131 of 245

Tencent Cloud EdgeOne

Builder setConnectTimeoutMillis(int connectTimeoutMillis)
ParameterconnectTimeoutMillis

Description
Set the connection timeout in milliseconds.
Default value: 60000.

setTotalTimeoutMillis
Set the total timeout that covers data read and write.

©2013-2022 Tencent Cloud. All rights reserved.

Page 132 of 245

Tencent Cloud EdgeOne

Builder setTotalTimeoutMillis(int totalTimeoutMillis)
Parameter
totalTimeoutMillis

Description
Set the total timeout in milliseconds.
Default value: 0 (no timeout).

setIdleTimeoutMillis
Set the idle connection timeout. When the timeout expires, connections are closed and cannot be reused.

©2013-2022 Tencent Cloud. All rights reserved.

Page 133 of 245

Tencent Cloud EdgeOne

Builder setIdleTimeoutMillis(int idleTimeoutMillis)
Parameter

Description

idleTimeoutMillis

The idle connection timeout in milliseconds.
Default value: 90000.

setSupportIpV6
Whether to support IPv6.

©2013-2022 Tencent Cloud. All rights reserved.

Page 134 of 245

Tencent Cloud EdgeOne

Builder setSupportIpV6(boolean supportIpV6)
Parameter

Description

supportIpV6 audio/video

Whether to support IPv6. Values: true , false .

proxyDefault value: false .

build
Create QuicClient.

©2013-2022 Tencent Cloud. All rights reserved.

Page 135 of 245

Tencent Cloud EdgeOne

QuicClient build()

QuicCallManage QUIC requests.
API

Description

enqueue﻿

Initiate an asynchronous QUIC network request.

©2013-2022 Tencent Cloud. All rights reserved.

Page 136 of 245

Tencent Cloud EdgeOne

cancel﻿
getQuicNetStats﻿

Cancel requests.
Get information about QUIC network status. For more details, see
QuicNetStats.

enqueue
Add an asynchronous QUIC request to the queue. You can get response from the callback function.

void enqueue(QuicCallback callback)©2013-2022 Tencent Cloud. All rights reserved.

Page 137 of 245

Tencent Cloud EdgeOne

Parameter

Description

callback

Return response from the callback function. For more details, see QuicCallback.

cancelCancel requests.

void cancel()©2013-2022 Tencent Cloud. All rights reserved.

Page 138 of 245

Tencent Cloud EdgeOne

getQuicNetStats
Get information about QUIC network status.

QuicNetStats getQuicNetStats()

QuicRequest
Request parameter©2013-2022 Tencent Cloud. All rights reserved.

Page 139 of 245

Tencent Cloud EdgeOne

API

Description

Builder﻿Construct a request parameter.

BuilderAPI

Description

setUrl

Set the request URL.

setIp

Set the request IP.

addHeader﻿

Add the request header

get﻿

Set the request type to GET.

post﻿

Set the request type to POST.

method﻿Set other request parameters.

build﻿Create a QuicRequest object.

setUrl
Set the request URL.

©2013-2022 Tencent Cloud. All rights reserved.

Page 140 of 245

Tencent Cloud EdgeOne

Builder setUrl(String url)Parameter

Description

url(Required) The request URL.

setIp
Set the request IP address.

©2013-2022 Tencent Cloud. All rights reserved.

Page 141 of 245

Tencent Cloud EdgeOne

Builder setIp(String ip)
Parameter

Description

ip(Optional) If you do not use DNS resolution, set the IP address that thehostname resolves to.

addHeader
Add the request header in a key-value format.

©2013-2022 Tencent Cloud. All rights reserved.

Page 142 of 245

Tencent Cloud EdgeOne

Builder addHeader(String key, String value)
Parameter

Description

key

Key of the header.

value

Value of the header.

get©2013-2022 Tencent Cloud. All rights reserved.

Page 143 of 245

Tencent Cloud EdgeOne

Set the request type to GET.

Builder get()post
Set the request type to POST.

©2013-2022 Tencent Cloud. All rights reserved.

Page 144 of 245

Tencent Cloud EdgeOne

Builder post(RequestBody body)
Parameter

Description

body

Body data.

methodConstruct DELETE, PUT and other requests.

©2013-2022 Tencent Cloud. All rights reserved.

Page 145 of 245

Tencent Cloud EdgeOne

Builder method(String method, RequestBody body)
Parameter

Description

methodSupported request methods: PUT, DELETE, HEAD, PATCH.

body

Body data.

build©2013-2022 Tencent Cloud. All rights reserved.

Page 146 of 245

Tencent Cloud EdgeOne

Create QuicRequest

QuicRequest build()

QuicResponse
Response informationAPI

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 147 of 245

Tencent Cloud EdgeOne

getCode﻿Get the response status code.

getHeaders﻿

Get the response headers.

getContentType﻿Get Content-Type.

getContentLength﻿

Get Content-Length.

body﻿Get the response body.

getCodeGet the response status code.

©2013-2022 Tencent Cloud. All rights reserved.

Page 148 of 245

Tencent Cloud EdgeOne

int getCode()

getHeaders
Get a list of response headers.

©2013-2022 Tencent Cloud. All rights reserved.

Page 149 of 245

Tencent Cloud EdgeOne

List<String> getHeaders()

getContentType
Get the content type from the response.

©2013-2022 Tencent Cloud. All rights reserved.

Page 150 of 245

Tencent Cloud EdgeOne

void setContentType(String contentType)
Parameter

Description

contentType

Get the content type.

getContentLength
Get the content length.

©2013-2022 Tencent Cloud. All rights reserved.

Page 151 of 245

Tencent Cloud EdgeOne

void setContentLength(long contentLength)
Parameter

Description

contentLength

Get the content length.

body
Get the body of the response.

©2013-2022 Tencent Cloud. All rights reserved.

Page 152 of 245

Tencent Cloud EdgeOne

ResponseBody body()

QuicCallback
Execute callbacks.
API

Description

onResponse﻿

The callback succeeded.

©2013-2022 Tencent Cloud. All rights reserved.

Page 153 of 245

Tencent Cloud EdgeOne

onFailed﻿

The callback failed.

onResponse
The callback function to execute when the request has succeeded.

void onResponse(QuicCall call, QuicResponse response) throws IOException
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 154 of 245

Tencent Cloud EdgeOne

callManage the QUIC request. For more details, see QuicCall.

response

Return the QUIC response. For more details, see QuicResponse.

onFailed
The callback function to execute when the request has failed.

void onFailed(QuicCall call,Parameter

int errorCode, String errorMsg)

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 155 of 245

Tencent Cloud EdgeOne

callManage the QUIC request. For more details, see QuicCall.

errorCodeThe error code.

errorMsg

The error message.

QuicNetStats
Get information about QUIC network status.
API

Description

isValid

Whether the value of status is valid.

isQuicWhether it is a QUIC request.

is0rttWhether it is a 0-RTT connection.

isConnReuse

Whether the connection is reused.

getConnectMs

Get the connection duration in milliseconds.

getDnsMs

Get the DNS duration in milliseconds.

getDnsCodeGet the DNS error code.

getTtfbMs

Get the time taken for the first byte to be received in milliseconds.

getCompleteMs

Get the time taken for the request to be completed in milliseconds. The time
taken by the connection is not included.

getSrttMs

Get the average round-trip time in milliseconds.

getPacketsSent

Get the number of packets sent in bytes.

getPacketsRetransmitted

Get the number of packets retransmitted in bytes.

getBytesSent

Get the number of bytes sent.

getBytesRetransmitted

Get the number of bytes retransmitted.

getPacketsLost

Get the number of packets lost in bytes.

getPacketsReceived

Get the number of packets received in bytes.

getBytesReceived

Get the number of bytes received.

©2013-2022 Tencent Cloud. All rights reserved.

Page 156 of 245

Tencent Cloud EdgeOne

getStreamBytesReceived

Get the number of bytes received within the stream.

©2013-2022 Tencent Cloud. All rights reserved.

Page 157 of 245

Tencent Cloud EdgeOne

iOS：

Last updated 2023-07-26 15:32:06

API Overview
API

Description

TQUICHTTPSessionManager﻿Session management APIs

TQUICURLSessionConfiguration﻿

QUIC request configuration

TQUICURLSessionDataTask﻿

Task management APIs

TQUICURLRequestSerialization﻿

Request serialization APIs

TQUICURLResponseSerialization﻿

Response serialization APIs

TQUICHTTPSessionManager
API

Description

manager﻿A static method to construct a TQUICHTTPSessionManager instance.
Create a TQUICHTTPSessionManager instance with the specified

initWithSessionConfiguration﻿

configuration. For detailed configuration, see
TQUICURLSessionConfiguration﻿

initWithBaseURL﻿Create a TQUICHTTPSessionManager instance with the specified
URL.

GET﻿

Initiate a GET request.

POST﻿

Initiate a POST request.

mangerCreate a TQUICHTTPSessionManager instance and pass the default QUIC configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 158 of 245

Tencent Cloud EdgeOne+ (instancetype)manager

initWithSessionConfiguration
Create a TQUICHTTPSessionManager instance and pass the QUIC configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 159 of 245

Tencent Cloud EdgeOne- (instancetype)initWithSessionConfiguration:(nullable %!s(<nil>) *)configuration
Parameter
configuration

Description
QUIC request configuration. For details, see
TQUICURLSessionConfiguration.

initWithBaseURL©2013-2022 Tencent Cloud. All rights reserved.

Page 160 of 245

Tencent Cloud EdgeOne

Create a TQUICHTTPSessionManager instance and pass the specified URL.

- (instancetype)initWithBaseURL:(nullable NSURL *)baseURL;- (instancetype)initWithBaseURL:(nullable NSURL *)baseURL
sessionConfiguration:(nullable %!s(<nil>) *)configuration;
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 161 of 245

Tencent Cloud EdgeOne

baseURL

The request domain name.

configuration

QUIC request configuration. For details, see
TQUICURLSessionConfiguration.

GET
Create a GET request.

- (nullable TQUICURLSessionDataTask *)GET:(NSString *)URLString©2013-2022 Tencent Cloud. All rights reserved.

Page 162 of 245

Tencent Cloud EdgeOne

parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSStr
timeoutInterval:(NSTimeInterval)timeoutInterval
downloadProgress:(nullable %!s(<nil>))downloadProgresssuccess:(nullable %!s(<nil>))successfailure:(nullable %!s(<nil>))failure
Parameter

Description

URLString

The request URL.

parameters

The request parameters.

headers

The request headers.

timeoutInterval

The connection timeout.

downloadProgress

The callback for download progress.

success

The callback for request success.

failureThe callback for request failure.

POST
Create a POST Request.

©2013-2022 Tencent Cloud. All rights reserved.

Page 163 of 245

Tencent Cloud EdgeOne- (nullable TQUICURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSSt
timeoutInterval:(NSTimeInterval)timeoutInterval
uploadProgress:(nullable %!s(<nil>))uploadProgress©2013-2022 Tencent Cloud. All rights reserved.

Page 164 of 245

Tencent Cloud EdgeOne

success:(nullable %!s(<nil>))successfailure:(nullable TQUICURLSessionTask)failure
Parameter

Description

URLString

The request URL.

parameters

The request parameters.

headers

The request headers.

timeoutInterval

The connection timeout.

uploadProgress

The callback to be executed to get upload progress.

success

The callback to be executed upon request success.

failureThe callback to be executed upon request failure.

TQUICURLSessionTaskSuccess
Execute the callback for task success.

©2013-2022 Tencent Cloud. All rights reserved.

Page 165 of 245

Tencent Cloud EdgeOne

typedef void (^TQUICURLSessionTaskSuccess)(%!s(<nil>) *task, id _Nullable responseO
Parameter

Descriptiontask

The request task.

responseObject

The response data.

TQUICURLSessionTaskFailure©2013-2022 Tencent Cloud. All rights reserved.

Page 166 of 245

Tencent Cloud EdgeOne

Execute the callback for task failure.

typedef void (^TQUICURLSessionTaskFailure)(%!s(<nil>) * _Nullable task, NSError *er
Parameter

Descriptiontask

The request task.

error

The error message.

©2013-2022 Tencent Cloud. All rights reserved.

Page 167 of 245

Tencent Cloud EdgeOne

TQUICURLSessionManager
Session management APIsAPI

Description

initWithSessionConfiguration﻿

Create an instance with the specified configuration.

dataTaskWithRequest﻿

Initiate requests with the NSURLRequest parameter.

setTaskDidFinishCollectingMetricsBlock﻿

Set the callback to collect statistics.

setTaskDidReceiveResponseBlock﻿

Set the callback block to receive request response.

initWithSessionConfiguration
Create a TQUICURLSessionManager instance and pass the QUIC configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 168 of 245

Tencent Cloud EdgeOne- (instancetype)initWithSessionConfiguration:(nullable %!s(<nil>) *)configuration
Parameter

Description

configuration

QUIC request configuration.

dataTaskWithRequest
Initiate requests with the NSURLRequest parameter.

©2013-2022 Tencent Cloud. All rights reserved.

Page 169 of 245

Tencent Cloud EdgeOne- (TQUICURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
uploadProgress:(nullable %!s(<nil>))uploadProgres
downloadProgress:(nullable %!s(<nil>))downloadProgrcompletionHandler:(nullable %!s(<nil>))completionHan
Parameter

Description

requestFor detailed configuration, see NSURLRequest.

uploadProgress

The callback to be executed to get upload progress.

©2013-2022 Tencent Cloud. All rights reserved.

Page 170 of 245

Tencent Cloud EdgeOne

downloadProgress

The callback to be executed to get download progress.

completionHandler

The callback to be executed upon request completion.

setTaskDidFinishCollectingMetricsBlock
Set the callback to collect statistics.

- (void)setTaskDidFinishCollectingMetricsBlock:(nullable %!s(<nil>))block
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 171 of 245

Tencent Cloud EdgeOne

block

Execute the callback block to collect statistics when the request iscomplete.

setTaskDidReceiveResponseBlock
Set the callback block to receive request response.

- (void)setTaskDidReceiveResponseBlock:(nullable %!s(<nil>))block
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 172 of 245

Tencent Cloud EdgeOne

block

Execute the callback block to receive request response.

TQUICURLSessionTaskDidReceiveResponseBlock
Execute the callback block to receive session task response.

typedef void (^TQUICURLSessionTaskDidReceiveResponseBlock)(%!s(<nil>) *session, %!sParameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 173 of 245

Tencent Cloud EdgeOne

sessionThe class that manages sessions.

task

The class that manages tasks.

response

The response result.

TQUICURLSessionTaskDownloadProgressBlock
Execute the callback block to get download progress.

©2013-2022 Tencent Cloud. All rights reserved.

Page 174 of 245

Tencent Cloud EdgeOne

typedef void (^TQUICURLSessionTaskDownloadProgressBlock)(NSProgress *downloadProgre
Parameter

Description

downloadProgress

The download progress.

TQUICURLSessionTaskUploadProgressBlock
Execute the callback block to get upload progress.

©2013-2022 Tencent Cloud. All rights reserved.

Page 175 of 245

Tencent Cloud EdgeOne

typedef void (^TQUICURLSessionTaskUploadProgressBlock)(NSProgress *uploadProgress)
Parameter

Description

uploadProgress

The upload progress.

QUICURLSessionTaskCompletionHandler©2013-2022 Tencent Cloud. All rights reserved.

Page 176 of 245

Tencent Cloud EdgeOne

Execute the callback block upon session completion.

typedef void (^TQUICURLSessionTaskCompletionHandler)(NSURLResponse *response, id reParameter

Description

response

For details about the response result, see NSURLResponse.

responseObject

The response data.

error

The error message.

©2013-2022 Tencent Cloud. All rights reserved.

Page 177 of 245

Tencent Cloud EdgeOne

TQUICURLSessionTaskDidFinishCollectingMetricsBlock
Execute the callback block to collect statistics upon session completion.

typedef void (^TQUICURLSessionTaskDidFinishCollectingMetricsBlock)(TQUICURLSession
Parameter

Description

sessionSession management.

task

Task management.

©2013-2022 Tencent Cloud. All rights reserved.

Page 178 of 245

Tencent Cloud EdgeOne

metrics

The network statistics.

TQUICURLSessionConfiguration
QUIC request configuration.
Member variable

Description
Set the QUIC version.
Supported versions: 043, Q046, Q050, Q051, draft-29, RFC-V1 (RFC
9000).
Values:quicVersion

TQUICVersionQ043 (default)
TQUICVersion046 audio/video proxy
TQUICVersion050 audio/video proxy
TQUICVersion051 audio/video proxy
TQUICVersionDraft29 audio/video proxy
TQUICVersionRFCV1 audio/video proxy
Supported congestion algorithms: CubicBytes, RenoBytes, BBR, PCC,
GCC.
Values:congestionType

TQUICCongestionTypeBBR (default)
TQUICCongestionTypeCubicBytes
TQUICCongestionTypeRenoBytes
TQUICCongestionTypePCC
TQUICCongestionTypeGCC

connectTimeoutMillis

The connection timeout in milliseconds.
Default value: 60000.
The idle connection timeout in milliseconds. This setting will affectidleTimeoutMillis

ipv6Enabled audio/video proxydnsParser

connection reuse.
Default value: 90000.
Whether to support IPv6.
Values: YES, NO (default).
The custom DNS parser. For details, see TQUICDNSParserDelegate.

TQUICDNSParserDelegate
Implement a custom DNS parsing.

©2013-2022 Tencent Cloud. All rights reserved.

Page 179 of 245

Tencent Cloud EdgeOne- (NSString *)lookup:(NSString *)hostName
Parameter

Description

hostName

The domain name, which is called back to resolve an IP address.

TQUICURLSession©2013-2022 Tencent Cloud. All rights reserved.

Page 180 of 245

Tencent Cloud EdgeOne

Task management APIsAPI

Description

sessionWithConfiguration﻿

Create an instance with the specified configuration.

sharedSession﻿Create an instance with the default configuration.

dataTaskWithRequest﻿

Create a task with the request parameters.

sessionWithConfiguration
Create an instance with the specified configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 181 of 245

Tencent Cloud EdgeOne+ (instancetype)sessionWithConfiguration:(%!s(<nil>) *)configuration
Parameter

Description

configuration

The QUIC request configuration.

sharedSession
Create an instance with the default configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 182 of 245

Tencent Cloud EdgeOne+ (instancetype)sharedSession

dataTaskWithRequest
Create a task based on the request parameters.

©2013-2022 Tencent Cloud. All rights reserved.

Page 183 of 245

Tencent Cloud EdgeOne- (nullable %!s(<nil>) *)dataTaskWithRequest:(NSURLRequest *)request
Parameter

Description

request

The request parameters. For more details, see NSURLRequest.

TQUICURLSessionTask©2013-2022 Tencent Cloud. All rights reserved.

Page 184 of 245

Tencent Cloud EdgeOne

Task management APIs.
API

Description

resume﻿Start a request task.

cancel﻿

Cancel a request task.

resumeStart a request task.

©2013-2022 Tencent Cloud. All rights reserved.

Page 185 of 245

Tencent Cloud EdgeOne- (void)resume

cancelCancel a request task.

- (void)cancel©2013-2022 Tencent Cloud. All rights reserved.

Page 186 of 245

Tencent Cloud EdgeOne

TQUICURLSessionDataTask
Manage request tasks. This API inherits the TQUICURLSessionTask class.
API

Description

resume﻿Start a request task.

cancel﻿

Cancel a request task.

resumeStart a request task.

©2013-2022 Tencent Cloud. All rights reserved.

Page 187 of 245

Tencent Cloud EdgeOne- (void)resume

cancelCancel a request task.

©2013-2022 Tencent Cloud. All rights reserved.

Page 188 of 245

Tencent Cloud EdgeOne- (void)cancel

TQUICURLRequestSerializationAPI

Description

TQUICHTTPRequestSerializer﻿

Serialize HTTP request parameters.

©2013-2022 Tencent Cloud. All rights reserved.

Page 189 of 245

Tencent Cloud EdgeOne

TQUICJSONRequestSerializer﻿

Serialize JSON request parameters.

TQUICHTTPRequestSerializer
Request serialization APIsAPI

Description

serializer﻿

Implement instantiation.

setValue﻿Set a value for the header field.

valueForHTTPHeaderField﻿

Return the value that corresponds to the header field.

requestWithMethod﻿Create NSMutableURLRequest.

multipartFormRequestWithMethod﻿Create NSMutableURLRequest to transfer streaming data.

serializer
Create a TQUICHTTPRequestSerializer instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 190 of 245

Tencent Cloud EdgeOne+ (instancetype)serializer

setValue
Set a value for the header field.

©2013-2022 Tencent Cloud. All rights reserved.

Page 191 of 245

Tencent Cloud EdgeOne- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(NSString *)field
Parameter

Descriptionvalue

The value of the header field.

field

The name of the header field.

valueForHTTPHeaderField©2013-2022 Tencent Cloud. All rights reserved.

Page 192 of 245

Tencent Cloud EdgeOne

Return the value that corresponds to the header field.

- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field
Parameter

Description

field

The name of the header field.

requestWithMethod
Create NSMutableURLRequest.

©2013-2022 Tencent Cloud. All rights reserved.

Page 193 of 245

Tencent Cloud EdgeOne- (nullable NSMutableURLRequest *)requestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(nullable id)parameters
error:(NSError * _Nullable __autorele
Parameter

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 194 of 245

Tencent Cloud EdgeOne

methodSet the HTTP request method, such as GET, POST, PUT, DELETE,
HEAD and PATCH.

URLString

The request URL.

parameters

The request parameters.

error

The error message.

multipartFormRequestWithMethod©2013-2022 Tencent Cloud. All rights reserved.

Page 195 of 245

Tencent Cloud EdgeOne- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(nullable NSDictionary <NSS
constructingBodyWithBlock:(nullable void (^)(id <%!s(error:(NSError * _Nullable __auto
Parameter
methodDescription
Set the HTTP request method, such as GET, POST, PUT, DELETE,
HEAD and PATCH.

URLString

The request URL.

parameters

The request parameters.

constructingBodyWithBlock

Construct the body using the block.

error

The error message.

TQUICJSONRequestSerializer
API

Description

serializerWithWritingOptions﻿

Create an instance.

serializerWithWritingOptions
Create a TQUICJSONRequestSerializer instance with the JSON serialization options.

©2013-2022 Tencent Cloud. All rights reserved.

Page 196 of 245

Tencent Cloud EdgeOne+ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions
Parameter

Description

writingOptions

Create an instance with the JSON serialization options.

TQUICMultipartFormData©2013-2022 Tencent Cloud. All rights reserved.

Page 197 of 245

Tencent Cloud EdgeOne

Multipart form data.
API

Description

appendPartWithFileURL﻿

Upload the form data with the specified file URL.

appendPartWithInputStream﻿

Upload the form data with the input stream.

appendPartWithFileData﻿

Upload form data using multipart.

appendPartWithFormData﻿

Add data parts.

appendPartWithHeaders﻿

Add the header fields and body data to the form.

throttleBandwidthWithPacketSize﻿

The bandwidth limit for uploads.

appendPartWithFileURL
Upload the form data with the specified file URL.

©2013-2022 Tencent Cloud. All rights reserved.

Page 198 of 245

Tencent Cloud EdgeOne- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
name:(NSString *)name
error:(NSError * _Nullable __autoreleasing *)error
Parameter

Description

fileURL

Add the file URL to the form.

name

The name of the associated file.

error

The error message.

©2013-2022 Tencent Cloud. All rights reserved.

Page 199 of 245

Tencent Cloud EdgeOne

appendPartWithInputStream
Upload data with the specified input stream.

- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream
name:(NSString *)name
fileName:(NSString *)fileName
length:(int64_t)length
mimeType:(NSString *)mimeType©2013-2022 Tencent Cloud. All rights reserved.

Page 200 of 245

Tencent Cloud EdgeOne

Parameter

Description

inputStream

The input stream.

name

The name of the input stream.

fileName

The name of the file associated with the input stream.

lengthThe length of the stream in bytes.

mimeType

The MIME type, such as image/jpeg. For more details, see HTTP
specifications.

appendPartWithFileData
Upload the form data using multipart.

©2013-2022 Tencent Cloud. All rights reserved.

Page 201 of 245

Tencent Cloud EdgeOne- (void)appendPartWithFileData:(NSData *)data
name:(NSString *)name
fileName:(NSString *)fileName
mimeType:(NSString *)mimeType
Parameter

Descriptiondata

The data to be added to the form.

name

The name of the associated data.

©2013-2022 Tencent Cloud. All rights reserved.

Page 202 of 245

Tencent Cloud EdgeOne

fileName
mimeType

The name of the associated file.
The MIME type, such as image/jpeg. For more details, see HTTP
specifications.

appendPartWithFormData
Add data parts.

- (void)appendPartWithFormData:(NSData *)data
name:(NSString *)name©2013-2022 Tencent Cloud. All rights reserved.

Page 203 of 245

Tencent Cloud EdgeOne

Parameter

Descriptiondata

The data to be added to the form.

name

The name of the associated data.

appendPartWithHeaders
Add the header fields and body data to the form.

- (void)appendPartWithHeaders:(nullable NSDictionary <NSString *, NSString *> *)hea©2013-2022 Tencent Cloud. All rights reserved.

Page 204 of 245

Tencent Cloud EdgeOne

body:(NSData *)body;
Parameter

Description

headers

The headers to be added.

body

The body data to be added.

throttleBandwidthWithPacketSize
The bandwidth limit for uploads.

©2013-2022 Tencent Cloud. All rights reserved.

Page 205 of 245

Tencent Cloud EdgeOne- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes
delay:(NSTimeInterval)delay
Parameter

Description

numberOfBytes

The maximum size of a packet in bytes. Default value: 16 KB.

delay

The read delay for a packet. Default value: 0 seconds.

TQUICURLResponseSerialization
Response serialization APIsAPI

Description

TQUICHTTPResponseSerializer﻿

Serialize HTTP response data.

TQUICJSONResponseSerializer﻿

Serialize JSON response data.

TQUICHTTPResponseSerializer
Response serialization APIsAPI

Description

serializer﻿

Implement instantiation.

validateResponse﻿Validate the response data.

serializer
Create a TQUICHTTPResponseSerializer instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 206 of 245

Tencent Cloud EdgeOne+ (instancetype)serializer

validateResponse
Validate the response data.

©2013-2022 Tencent Cloud. All rights reserved.

Page 207 of 245

Tencent Cloud EdgeOne- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response
data:(nullable NSData *)data
error:(NSError * _Nullable __autoreleasing *)error
Parameter

Description

response

The response result to be validated. For more details, see
NSHTTPURLResponse.

©2013-2022 Tencent Cloud. All rights reserved.

Page 208 of 245

Tencent Cloud EdgeOne

data

The returned data.

error

The validation error.

TQUICJSONResponseSerializer
API

Description

serializerWithWritingOptions﻿

Create an instance.

serializerWithWritingOptions
Create an instance with the JSON serialization options.

©2013-2022 Tencent Cloud. All rights reserved.

Page 209 of 245

Tencent Cloud EdgeOne+ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions
Parameter

Description

serializerWithReadingOptions

Create an instance with the JSON serialization options.

TQUICURLSessionTaskMetrics©2013-2022 Tencent Cloud. All rights reserved.

Page 210 of 245

Tencent Cloud EdgeOne

The QUIC network metrics collected for a session.
PropertytransactionMetrics

Description
An array of metrics for each request during the session. For more details,
see TQUICURLSessionTaskTransactionMetrics.

taskInterval

The time taken between when the task is created and when the task iscompleted.

redirectCount

Number of redirects.

TQUICURLSessionTaskTransactionMetrics
The QUIC network metrics collected for a request.
Property

Description

isValid

Whether the value of status is valid.

isQuicWhether it is a QUIC request.

is0rttWhether it is a 0-RTT connection.

isConnReuse

Whether the connection is reused.

connectMillis

Get the connection duration in milliseconds.

dnsMillis

Get the DNS duration in milliseconds.

dnsCodeGet the DNS error code.

ttfbMillis

Get the time taken for the first byte to be received in milliseconds.

completeMillis

Get the time taken for the request to be completed in milliseconds. The
time taken by the connection is not included.

srttMicros

Get the average round-trip time in milliseconds.

packetsSent

Get the number of packets sent in bytes.

packetsRetransmitted

Get the number of packets retransmitted in bytes.

bytesSent

Get the number of bytes sent.

bytesRetransmitted

Get the number of bytes retransmitted.

packetsLost

Get the number of packets lost in bytes.

packetsReceived

Get the number of packets received in bytes.

©2013-2022 Tencent Cloud. All rights reserved.

Page 211 of 245

Tencent Cloud EdgeOne

bytesReceived

Get the number of bytes received.

streamBytesReceived

Get the number of bytes received within the stream.

©2013-2022 Tencent Cloud. All rights reserved.

Page 212 of 245

Tencent Cloud EdgeOne

IPv6 Access：

Last updated 2023-08-08 14:40:14

Function Introduction
EdgeOne supports one-click enable of IPv6 access, allowing IPv6 clients to access nodes using the IPv6 protocol.

：

Note

Currently, the majority of EdgeOne nodes support IPv6 access. You can contact us to confirm the specific resource
coverage.

Usage Scenarios
IPv6-only network environment: Some regions and organizations may already be using IPv6-only network
environments, and devices in these network environments may not be able to directly access IPv4-based services. By
enabling IPv6 access, you can ensure that these clients can normally access your accelerated resources.
Dual-stack network environment: For dual-stack network environments that support both IPv4 and IPv6, clients
can automatically select whether to use IPv4 or IPv6 protocol to access accelerated resources based on network
conditions. In some cases, IPv6 connections may be faster than IPv4, so enabling IPv6 access can help improve theaccess performance of these clients.
Future network compatibility: As IPv4 address resources gradually become exhausted, more and more networks
and devices will adopt IPv6. By enabling IPv6 access, you can ensure that your acceleration service remains
compatible with these emerging networks and devices in the future.
Policy and compliance requirements: Some regions or industries may require IPv6 support in services to meet
policy or compliance requirements. In this case, enabling IPv6 access can help you meet these requirements.

Directions
1. Log in to the EdgeOne console, click on the site list in the left menu bar, click on the site to be configured in the site
list, and enter the site details page.
2. On the site details page, click on Security Acceleration > Network Optimization to enter the network
optimization details page.
3. Find the IPv6 access configuration card, click on globally enable to enable IPv6 access for all domains of the site.

©2013-2022 Tencent Cloud. All rights reserved.

Page 213 of 245

Tencent Cloud EdgeOne©2013-2022 Tencent Cloud. All rights reserved.

Page 214 of 245

Tencent Cloud EdgeOne

Maximum Upload Size：

Last updated 2023-08-08 14:41:59

Function Introduction
The maximum upload size is the maximum value of data that a client user can upload in a single request. If the set limit
is exceeded, EdgeOne will respond to the client with a 413 (Request Entity Too Large).

：

Note

1. Only EdgeOne Enterprise and Standard plans support disabling the upload size limit.
2. The maximum upload size limit is enabled by default, with a limit of 800MB.

Usage Scenarios
1. Large file upload: For businesses involving large file uploads, such as online video platforms, large-scale game
distribution, and big data analysis, you can increase the upload size limit or disable it directly to allow your large files tobe uploaded smoothly.
2. Defend against malicious uploads: For businesses with frequent user interactions, such as social media, forums
or blogs, you may encounter malicious users uploading excessively large files. You can enable the size limit andreduce the limit to prevent large files from being uploaded to the origin, thereby alleviating the pressure on the origin,preventing potential security risks, and improving the user experience.
3. Save traffic: For traffic-sensitive businesses, such as online education, online meetings, and API services, you may
want to save traffic by limiting the size of uploaded files. You can enable the size limit and adjust the limit to a smaller
value to reduce unnecessary transmission traffic and lower traffic costs.
You can flexibly configure the "maximum upload size" to meet the needs of various business scenarios.

Directions
Scenario 1: Configure the maximum upload size for all domain names of the site
If you need to configure the same maximum upload size for the whole connected site or as a site-level fallback
configuration, please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. In the site details page, click Site Acceleration > Network Optimization to enter the network optimization details
page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 215 of 245

Tencent Cloud EdgeOne

3. Find the maximum upload size configuration card and click Global Settings.

4. In the pop-up window, check Enable Size Limit and modify the limit value. Click Save to make it effective.

Scenario 2: Configure the maximum upload size for specified domain names, paths, or fileextensions, etc.
If you need to configure different maximum upload sizes for different domain names, paths, or file extensions, etc., forexample, configure the maximum upload size for the www.example.com domain under the example.com site
to be 20 MB, please refer to the following steps:
1. Log in to the EdgeOne console and click Site List in the left sidebar. In the site list, click the target site to enter thesite details page.
2. In the site details page, click Rule Engine.
3. In the rule engine management page, click Create Rule to enter the new rule editing page.
4. In the rule editing page, enter the rule name, select Host as the matching type, and configure it aswww.example.com .
5. Click Operation, and in the pop-up operation list, select Maximum Upload Size as the operation, and click Enable
Size Limit, with a limit value of 20 MB.

©2013-2022 Tencent Cloud. All rights reserved.

Page 216 of 245

Tencent Cloud EdgeOne

6. Click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 217 of 245

Tencent Cloud EdgeOne

WebSocket：

Last updated 2023-08-08 14:43:14

Function Introduction
EdgeOne supports WebSocket protocol access, which enables the server to actively push data to the client.
WebSocket protocol is a persistent protocol based on TCP, which implements full-duplex communication between theclient and the server, allowing the server to actively send information to the client. Before the WebSocket protocol,
Web Apps that implemented client-server duplex communication had to constantly send HTTP requests for inquiries,
which led to increased service costs and inefficiency. Due to the advantages of full-duplex communication, WebSocket
is widely used in social subscription, collaborative office, market updates, interactive live streaming, online education,
Internet of Things, and other scenarios, which can better save server resources and bandwidth, and achieve morereal-time communication.

：

Note

1. Currently, only HTTP/1.1-based WebSocket is supported, and HTTP/2 WebSocket is not supported.
2. Maximum connection timeout duration supported: 300 seconds.

Directions
Scenario 1: Configure WebSocket for all domain names of the site
If you need to enable/disable WebSocket for the whole connected site, or as a site-level fallback configuration, pleaserefer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list to enter the site details page.
2. On the site details page, click on Security Acceleration > Network Optimization to enter the network optimization
details page.
3. Find the WebSocket configuration card, click the switch to enable or disable the WebSocket function,and configure
the maximum connection timeout duration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 218 of 245

Tencent Cloud EdgeOne

Activated: By default, WebSocket protocol is not supported. When enabled, WebSocket protocol is supported.
Maximum connection timeout duration: If no data is sent or received within the timeout period, the connection will
be disconnected.

Scenario 2: Configure WebSocket for specified domain names
If you need to configure WebSocket for different domain names, for example, configure WebSocket for the
www.example.com domain under the example.com site, please refer to the following steps:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page. On the rule editing
page, select Host as the matching type and configure it as www.example.com .
4. Click on the operation, and in the pop-up operation list, select WebSocket as the operation, click the switch toenable, and configure the maximum connection timeout duration.

：

Note

Maximum connection duration: Can be configured between 1-300 seconds.

5. Click Save and Publish to complete the rule configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 219 of 245

Tencent Cloud EdgeOne

Client IP Geolocation Header：

Last updated 2023-08-02 17:17:40

Overview
Real client IP header allows you to create a custom origin-pull HTTP request header that carries the real client IP
information.

Directions
1. Log in to the EdgeOne console. Click Site acceleration > Network optimization on the left sidebar.

2. On the network optimization page, select a site and click

to enable the "Real client IP header" feature.

3. In the pop-up window, enter a header name, such as Tencent-Client-IP, and click Save.

©2013-2022 Tencent Cloud. All rights reserved.

Page 220 of 245

Tencent Cloud EdgeOne

Client IP Geographical Location：

Last updated 2022-12-07 16:18:00

Overview
The custom header can carry the geographical location information of the client IP to the origin.

：

Note

The country/region value is represented by an ISO 3166-1 alpha-2 code (a two-letter country/region code).
Currently, IPv6 is not supported.

Directions
1. Log in to the EdgeOne console. Click Site Acceleration > Network optimization on the left sidebar.

2. On the Network optimization page, select the target site and click

to enable Client IP Geographical

Location.

3. In the pop-up window, customize the header name or directly use the default name EO-Client-IPCountry
and click Save.

©2013-2022 Tencent Cloud. All rights reserved.

Page 221 of 245

Tencent Cloud EdgeOne

gRPC：

Last updated 2023-08-08 15:35:23

EdgeOne Support Status for gRPCEdgeOne supports enabling gRPC protocol support within the console (default is off). Once enabled, it cansimultaneously support HTTP/HTTPS/gRPC protocols, automatically adapting to the user's request protocol, i.e.,
using HTTP protocol for HTTP requests and gRPC protocol for gRPC requests.

：

Note

1. Currently, only Simple RPC and Server-side streaming RPC modes are supported;
2. gRPC is implemented based on end-to-end HTTP/2, so please make sure that HTTP/2 access and HTTP/2 originpull are enabled when enabling gRPC.

What is gRPC?
gRPC (gRPC Remote Procedure Calls) is an open-source remote procedure call system initiated by Google. The
system is designed based on the HTTP/2 standard and features bidirectional streaming, flow control, header
compression, and multiplexed requests on a single TCP connection.

Directions
1. Log in to the EdgeOne console, click on the site list in the left menu bar, click on the site to be configured in the site
list, and enter the site details page.
2. On the site details page, click on Security Acceleration > Network Optimization, and find the gRPC module.

3. Click on the "switch" of the gRPC module to enable or disable gRPC protocol support.

©2013-2022 Tencent Cloud. All rights reserved.

Page 222 of 245

Tencent Cloud EdgeOne

URL Rewrite
Access URL Redirection：

Last updated 2024-05-08 20:36:48

Overview
EdgeOne Nodes redirect the client requests request URL to the target URL by responding to 3XX status codes. Thisfeature can change the URL redirection that originally needed to be generated and returned by the origin server inyour business scenario to be directly constructed and returned by the EdgeOne edge nodes, reducing the network
latency of following the origin-pull and the load of the origin server generating the URL redirection, and improving theaccess performance of the client.

Use Cases
The following are common Applicable Scenarios for Rewrite access URL:
Migration of website or reconstruction: When a website undergoes migration or reconstruction, the URL structure
may change. To maintain the validity of old links, you can use URL redirect to redirect old URLs to new URLs,
ensuring that users and Search Engines can smoothly access the new resources.
Geographical location or Device Type orientation: Based on the user's geographical location or device type, you
can use URL redirect to guide users to different resources or pages. For example, provide optimized mobile pages formobile device users, or provide different language versions of pages based on the user's region.
Temporary maintenance or activity page: When a website is undergoing temporary maintenance or hosting a
specific event, you can use URL redirect to guide users to the maintenance notification page or activity page, thereby
improving the user Experience.

Directions
Scenario One: Domain Services Require a 302 Redirection to a Temporary MaintenancePage
If you require temporary maintenance for the domain business www.example.com under your example.com
site, and want to redirect all requests under the domain tohttps://www.example.com/public/waitingpage/index.html via a 302 redirection, you can refer to thefollowing steps:©2013-2022 Tencent Cloud. All rights reserved.

Page 223 of 245

Tencent Cloud EdgeOne

1. Log in to the EdgeOne console, click Site List on the left sidebar, and click the Site to be configured in the site list.
2. On the site details page, click on the Rule Engine.
3. On the rule engine management page, click on Create rule, which will lead to the new rule editing page.
3.1 On the rule editing page, select the Matching type as HOST is www.example.com .
3.2 Click on Action, and in the pop-up action list, select the Action as Redirect access URL.
3.3 Configure the rules for Redirect access URL. Select the Target protocol as HTTPS, the Target hostname as
Follow request, and the Destination Path as /public/waitingpage/index.html .
4. Click Save and Publish to complete the configuration. The complete rule configuration is as shown below:

Scenario Two: Migration of Origin Server Resource Directory, Client Request URL Must
Remain Unchanged
If you need to migrate all jpg image resources from the test directory to the newtest directory under the
www.example.com domain of your example.com site, but the client request URL needs to remainunchanged, that is, the test directory is still accessed. You may refer to the following steps:
1. Log in to the EdgeOne console, click Site List on the left sidebar, and click the Site to be configured in the site list.
2. On the site details page, click on the Rule Engine.
3. On the rule engine management page, click on Create rule, which will lead to the new rule editing page.
3.1 On the rule editing page, select the Matching type as HOST is www.example.com .
3.2 Click on Action, and in the pop-up action list, select the action as Redirect access URL.
3.3 Configure the rules for Redirect access URL. Select the Target protocol as Follow request, the Target hostname
as Follow request. And you can configure the Destination Path as Replace by regex, input the Regular Expression as/test/([^/]*)\\.jpg to match the destination path, and replace it with /newtest/$1.jpg .
4. Click Save and Publish to complete the configuration. The complete rule configuration is as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 224 of 245

Tencent Cloud EdgeOne

Relevant References
The explanations for each configuration item of the redirect access URL are as follows:
Configuration
Item
Target Protocol

Description
The request protocol of the target redirect address, default to follow the request, can support
specifying the jump to HTTP/HTTPS protocol.

TargetThe Hostname part of the target redirect address, default to follow the request, support

Hostnamemodifying to a custom domain. For example, www.example.com.
The path part of the target redirect address, providing three mode options:
Follow request: Default configuration, follow the request path.
Custom: Customize a complete path, replace the original request path with the target path.
For example, /download .

Destination
Path

Regular Expression: Support matching and replacing paths through Google RE2 Regex. At
the same time, it supports using $num to refer to the Regex capture group, where num
represents the group number, up to $9.
For example: Currently, we hope to replace the path /old-path/1234 with /newpath/1234 , we can configure the Regex expression as ^/old-path/(\\d+)$ , andthe replacement path can be configured as /new-path/$1 , where $1 refers to the first
capture group in the Regex expression, that is, the number part of the path.

©2013-2022 Tencent Cloud. All rights reserved.

Page 225 of 245

Tencent Cloud EdgeOne

Query String

Whether to carry the original query string to the target URL, default to enable, that is, carry
the original query string after redirecting.

Status Code

Select the response status code for the redirect: 302 (default), 301, 303, and 307.

©2013-2022 Tencent Cloud. All rights reserved.

Page 226 of 245

Tencent Cloud EdgeOne

Origin-Pull URL Rewrite：

Last updated 2024-08-01 21:32:16

Overview
When the client sends the request to the EdgeOne node, and the request fails to hit the node cache and needs to be
returned to the origin, it supports the redirection of the request to the destination URL of the origin server according to
the rules set by origin-pull URL rewrite. This feature does not affect the node cache.

Use cases
In certain cases, the URL accessed by the client has been published and should not be modified, but the origin server
has changed its URL for certain reasons; or the URL accessed by the client differs from that on the origin server for
SEO. Then, you can set origin-pull URL rewrite rules, so that the node can rewrite the origin-pull URL to the actual
resource URL on the origin server without changing the URL accessed by the client.

Directions
Scenario: The client request URL is inconsistent with the corresponding origin server
resource path
For example, when a client requests the URL path https://www.example.com/online/index.html fromthe site domain www.example.com , and the file directory has been changed, it is necessary to remove thedirectory prefix /online during the origin-pull to access the corresponding file resources. The following steps canbe referred to:
1. Log in to the EdgeOne console, click Site List on the left sidebar, and click the Site to be configured in the site list.
2. On the site details page, click on the Rule Engine.
3. On the rule engine management page, click on Create rule, which will lead to the new rule editing page.
3.1. On the rule editing page, select the Matching type as HOST is www.example.com .
3.2. Click on Action, and in the pop-up action list, select the action as Rewrite origin-pull URL.
3.3. Select the Type as Remove path prefix, with the path prefix being /online , as configured below:©2013-2022 Tencent Cloud. All rights reserved.

Page 227 of 245

Tencent Cloud EdgeOne

4. Click Save and Publish to complete the configuration.

Relevant References
The explanations for each configuration item of the origin-pull URL rewrite are as follows:
Type

Description

Add path

Add the specified prefix to the request URL. For example, if the request URL is
https://www.example.com/path0/index.html and the prefix to be added isprefix/prefix , the rewritten URL will behttps://www.example.com/prefix/path0/index.html .

Remove path
prefixRemove the specified prefix from the request URL. For example, if the request URL is
https://www.example.com/path0/path1/index.html and the prefix to be
removed is /path0 , the rewritten URL will behttps://www.example.com/path1/index.html .
Replace the complete request URL. For example, if the request URL is

Replace fullhttps://www.example.com/path0/index.html and the path to be replaced ispath/new/page.html , the rewritten URL will behttps://www.example.com/new/page.html .

©2013-2022 Tencent Cloud. All rights reserved.

Page 228 of 245

Tencent Cloud EdgeOne

Modifying Header
Modifying HTTP Response Headers：

Last updated 2023-10-13 14:22:48

Overview
Support customization/adding/deleting HTTP node response headers (responding to the customer's direction),
modifying HTTP node response headers will not affect the node cache.

：

Note

EdgeOne has automatically carried some response headers by default, and you don't need to configure them. For
details, please refer to: Default HTTP Response Headers.

Scenario: Cross-domain header response only allows specified
domain names to access page resources
Example Scenario
If your business scenario involves cross-domain access, and the resources of the current business domain namewww.example.com only allow pages from https://www.example.com to access the acceleration domain
name, you can refer to the following steps.

Directions
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 229 of 245

Tencent Cloud EdgeOne

3.1 On the rule editing page, select the matching type as HOST equals www.example.com .
3.2 Click on the operation, and in the pop-up operation list, select the operation to modify the HTTP node
response header.
3.3 Select the type as set, and set the Access-Control-Allow-Origin as https://www.example.com .

4. Click Save and Publish to complete the rule configuration.

Related References
Supported Types Description:
Type
Set

Description
Change the value of the specified header parameter to the set value, and the header is unique.
Note: If the specified header does not exist, the header will be added.

Add

Add the specified header. Note: If the header already exists, it will still be added and will not
overwrite the existing header.

DeleteDelete the specified header.

Supported Header Types Description:
HeaderType
CustomDescription
Supports modifying custom header content, fill in the description as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 230 of 245

Tencent Cloud EdgeOne

Name: 1 - 100 characters, consisting of numbers 0 - 9, characters a - z, A - Z, and special symbols-.
Value: Supports 1 - 1000 characters, does not support Chinese.
Supports modifying the following specified headers:Access-Control-Allow-Origin: Used to specify the source (domain name) allowed to accessresources, must contain http:// or https://. Supports setting Wildcard * , i.e., allowing all domain
requests.
Access-Control-Allow-Methods: Used to set the HTTP request methods allowed for cross-domain
Specify
Headeraccess, such as POST, GET, OPTIONS.
Access-Control-Max-Age: Specifies how many seconds the preflight request result is valid, inseconds.
Content-Disposition: Activates the browser's download pop-up window and can set the default
download file name. For example: Content-Disposition: attachment;filename=FileName.txt
Content-Language: Defines the language code used by the page. For example: Content-Language:
zh-CN

Limitations
In the same Modify HTTP Request Header operation, multiple different types of operations can be added, up to 30,
and the execution order is from top to bottom.
Some standard headers are not supported for modification, as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 231 of 245

Tencent Cloud EdgeOne

Accept-Ranges
Age
Allow
Authentication-Info
Cache-Control
Connection
Content-Encoding
Content-Length
Content-Location
Content-MD5
Content-Range©2013-2022 Tencent Cloud. All rights reserved.

Page 232 of 245

Tencent Cloud EdgeOne

Content-Type
Date
Error
ETag
Expires
If-Modified-Since
Last-Modified
Meter
Proxy-Authenticate
Retry-After
Set-Cookie
Transfer-Encoding
Vary
WWW-Authenticate©2013-2022 Tencent Cloud. All rights reserved.

Page 233 of 245

Tencent Cloud EdgeOne

Modifying HTTP Request Headers：

Last updated 2023-10-13 14:24:24

Overview
When Edgeone nodes origin-pull, if the origin needs to obtain some specific information through the HTTP request
header for business logic judgment or data analysis, such as: client device type, acceleration service provider. Thiscan be achieved by customizing/adding/deleting HTTP origin-pull request headers (node origin-pull direction), where
the header value supports variables, please refer to EdgeOne preset variables for details.

：

Note

EdgeOne supports carrying X-Forwarded-For and X-Forwarded-Proto by default for origin-pull, and you
do not need to configure it again, please see: Default HTTP Headers of Origin-Pull Requests.

Directions
Scenario 1: Carry device type information to the origin when origin-pulling
For example: If you want the current domain name www.example.com to aggregate the User-Agent header
value carried by the client request into device type-related headers and pass them to the origin when origin-pulling,
you can refer to the following steps for configuration:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page.
3.1 On the rule editing page, select the matching type as Host equals www.example.com .
3.2 Click on the operation, and in the pop-up operation list, select the operation to modify the HTTP origin-pull
request header.

©2013-2022 Tencent Cloud. All rights reserved.

Page 234 of 245

Tencent Cloud EdgeOne

3.3 Select the type as Add, the preset header with the header name EO-Client-Device , and the configuration
result is as follows:

4. Click Save and Publish to complete the rule configuration.

Scenario 2: Pass the acceleration domain name to the origin through a custom header when
origin-pulling
For example: If your current domain name www.example.com has been configured to origin-pull Host for otherdomain names, and you want to pass the acceleration domain name to the origin through a custom header
Tencent-Acceleration-Domain , you can refer to the following steps for configuration:
1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site to be configured in thesite list.
2. On the site details page, click on the rule engine.
3. On the rule engine management page, click Create Rule to enter the new rule editing page.
3.1 On the rule editing page, select the matching type as Host equals www.example.com.
3.2 Click on the operation, and in the pop-up operation list, select the operation to modify the HTTP origin-pull
request header.
3.3 Select the type as Add, the header name as Tencent-Acceleration-Domain , and the header value as${http.request.host} , and the configuration result is as follows.

©2013-2022 Tencent Cloud. All rights reserved.

Page 235 of 245

Tencent Cloud EdgeOne

4. Click Save and Publish to complete the rule configuration.

Related Reference
The types supported by modifying the HTTP origin-pull request header are described as follows:
Type

Description

Set

Change the value of the specified header parameter to the set value, and the header is unique.
Note: If the specified header does not exist, the header will be added.

Add

Add the specified header. Note: If the header already exists, the original header will be overwritten.

DeleteDelete the specified header.

Supported header name description:
Header Type

CustomDescription
Custom header.
Name: 1 - 100 characters, consisting of numbers 0 - 9, characters a - z, A - Z, and special
symbol -.
Value: 1 - 1000 characters, Chinese not supported.

PresetHeaders aggregated based on client User-Agent information:

HeaderClient Device Type: EO-Client-Device
Value: Mobile , Desktop , SmartTV , Tablet or Others
Client Operating System: EO-Client-OS
Value: Android ,iOS , Windows , MacOS , Linuxor Others

Client Browser Type: EO-Client-Browser
Value: Chrome , Safari , Firefox , IE or Others©2013-2022 Tencent Cloud. All rights reserved.

Page 236 of 245

Tencent Cloud EdgeOne

Limitations
In the same Modify HTTP Request Header operation, multiple different types of operations can be added, up to 30,
and the execution order is from top to bottom.

©2013-2022 Tencent Cloud. All rights reserved.

Page 237 of 245

Tencent Cloud EdgeOne

Custom Error Page：

Last updated 2024-01-02 10:29:50

Overview
EdgeOne provides support to redirect to a specified custom page and return a 302 status code when the origin server
responds with specific error statuses. This helps your site inform users of the current website status by the customized
error page, avoiding uncertainty regarding the specific cause and resolution when a request error occurs.
NoteThis feature is the redirection of origin-pull error status. It does not support redirection of status codes generated byaccess control policies such as token authentication or web protection rules.

Directions
For instance, your self-built e-commerce service website provides online payment capability throughshop.example.com . During peak user traffic, the original server could potentially become overloaded,
responding with a 503 status code. In order to avoid losing users, I hope to customize an error pagehttps://www.example.com/error.html to guide users to other e-commerce platforms. You can follow thesteps:
1. Log in to the TencentCloud EdgeOne console, click Site List in the left sidebar and click the Site to be configuredin the site list.
2. On the site detail page, click on Rule Engine.
3. On the rule engine management page, click on Create rule to enter the new rule's editing page. In this scenario,
you can operate as follows:
3.1 On the rule editing page, select the matching type as HOST equal to shop.example.com .
3.2 Click Action, and select Custom Error Page in the pop-up action list.
3.3 To configure the custom error page, select the Status code as 503 and enter
https://www.example.com/error.html for the Page URL. The relevant configuration items are describedas follows:
Configuration Item

Description

Status code

Specifies the error status code returned by the origin:4XX:400, 403, 404, 405, 414, 416, 451
5XX:500, 501, 502, 503, 504

Page URL

Designate the error page address, for©2013-2022 Tencent Cloud. All rights reserved.

Page 238 of 245

Tencent Cloud EdgeOne

instance: https://www.example.com/custom-page.html

4. The complete rule configuration is as shown below. Click Save and publish, the rule configuration will becompleted.

©2013-2022 Tencent Cloud. All rights reserved.

Page 239 of 245

Tencent Cloud EdgeOne

Request and Response Actions
Processing order：

Last updated 2024-05-28 14:03:42
This article introduces the processing order of various module rules configured in the platform after the client initiates arequest to EdgeOne, helping users understand the effective order and impact of the rules to ensure that the configured
rules work as expected.

Processing order

After the user initiates a request, the request will be processed in the above order. For example, if the user configures
the modification of HTTP headers in both the rule engine and the Edge functions, the final result will be based on theprocessing of the Edge functions since they are processed later.
1. Multiple rules may be triggered in the security service module, and the relevant processing order is as follows:
The DDoS protection request processing order only applies to users who have purchased the exclusive DDoS
protection with L4 proxy. For details, please refer to the DDoS protection overview.
The Web protection module contains the bot management module. For the request processing order within the Webprotection module, please refer to the Web Protection request processing order. For the rule application order within
the bot management module, please refer to the bot management overview.
If a request triggers a security policy in the EdgeOne security protection module, and the action is interception, discard
and blacklist, or IP blocking, the request will be rejected.

©2013-2022 Tencent Cloud. All rights reserved.

Page 240 of 245

Tencent Cloud EdgeOne

2. The rule priority in the rule engine is higher than the global site setting rules, and the rule application order in the ruleengine is that the lower rules have higher priority. For details, please refer to the rule engine overview.
3. When a request triggers an Edge function rule, the request will be processed by the Edge functions. Edge functions
can access third-party services, EdgeOne cache content, or return to the client's origin through sub-requests, ordirectly respond to client requests.
4. When requests to the EdgeOne node Cache, if the current node does not have Cache, it will continue to origin-pull.
If the node hits the Cache, it will not Trigger the subsequent origin-pull rules and directly Return the corresponding
resources to the user.

©2013-2022 Tencent Cloud. All rights reserved.

Page 241 of 245

Tencent Cloud EdgeOne

Default HTTP Headers of Origin-Pull
Requests：

Last updated 2023-12-18 15:24:13

Overview
EdgeOne passes through all client request headers to the origin, and the origin-pull request carries the default custom
request headers of EdgeOne. To modify the HTTP headers of origin-pull requests, see Modifying HTTP Headers ofOrigin-Pull Requests.

Default HTTP headers of origin-pull requests
EdgeOne adds the following default HTTP headers to origin-pull requests.

EO-Connecting-IP
The EO-Connecting-IP header records the IP that of the request initiator. If the request is not forwarded by any
proxy, the IP address in the header is the real IP address of the client. Otherwise, it’s the proxy IP.

X-Forwarded-For
This header records the proxy IP and real client IP. If a client request is forwarded to an EdgeOne node after multiple
hops, the header records the real client IP and the IP of proxy before the EdgeOne node. The value of the header isdetermined based on the following rules:©2013-2022 Tencent Cloud. All rights reserved.

Page 242 of 245

Tencent Cloud EdgeOne

If a request sent to an EdgeOne node carries the X-Forwarded-For header that has recorded the client IP
address, EdgeOne appends the IP address of the proxy before the EdgeOne node to the header. For example, if theclient request carries X-Forwarded-For: 192.168.1.1 (where 192.168.1.1 is the client IP) and isforwarded to an EdgeOne node via the proxy 10.1.1.1 , the header of the origin-pull request is X-ForwardedFor: 192.168.1.1,10.1.1.1 .
If the request does not carry the X-Forwarded-For header, EdgeOne adds this header to the origin-pull request,
taking the proxy IP of the EdgeOne node as the value. In this case, it’s the same as the EO-Connecting-IP
header.
For more information, see X-Forwarded-For.

X-Forwarded-Proto
The X-Forwarded-Proto header records the HTTP protocol used by the client to initiate the request. Validvalues:X-Forwarded-Proto: httpX-Forwarded-Proto: https
X-Forwarded-Proto: quic
For more information, see X-Forwarded-Proto.

CDN-Loop
It records how many times a client request passes an EdgeOne node. The count is added by one every time therequest passes the node. When the count reaches 16, the EdgeOne node denies the request and returns the 423
status code.

Example: CDN-Loop: TencentEdgeOne; loops=3 .

EO-LOG-UUID
It carries the unique identifier of the request. When an access exception occurs, you can locate the problem byquerying logs with this UID.
Example: EO-LOG-UUID: 4105283880544427145 .

©2013-2022 Tencent Cloud. All rights reserved.

Page 243 of 245

Tencent Cloud EdgeOne

Default HTTP Response Headers：

Last updated 2024-05-08 21:20:09

Overview
This document describes default response headers that EdgeOne passes to the client. These headers follow theorigin unless there are custom HTTP headers.

Default HTTP response headers
EdgeOne adds the following default HTTP response headers to responses to the client.

EO-Cache-Status
EO-Cache-Status is used to indicate whether the current Client-initiated requests hit the Cache or not, with thefollowing values:
EO-Cache-Status: HIT : Indicates that the requested resources hit the Cache on the EdgeOne node and theCache is not expired, directly responded by the node to the user requests.
EO-Cache-Status: MISS : Indicates that the requested resources did not hit the Cache on the EdgeOne node,or hit the Cache but the Cache is expired, the node performs origin-pull verification, the origin file is updated andresponded with a 200 status code, the node needs to origin-pull the resources.
EO-Cache-Status: RefreshHit : Indicates that the requested resources hit the Cache on the EdgeOne node,but the Cache is expired, the node performs origin-pull verification, the origin file is not updated and responded with a
304 status code, the node continues to use the Cache to respond to user requests.

Server©2013-2022 Tencent Cloud. All rights reserved.

Page 244 of 245

Tencent Cloud EdgeOne

This header indicates the server name. The header value depends on the service that the Web Server is built on. Bydefault, this header follows the origin response (if exists). Otherwise, the EdgeOne node adds this header with thevalue of Server:TencentEdgeOne . For more information, see Server.
Values of Server header for different origin types:
Cloud Object Storage (COS) origin: Server: tencent-cos
Cloud Virtual Machine (CVM) origin: Server: nginx , Server: apache , Server: tomcat , orServer: Microsoft-IIS
Cloud Load Balancer (CLB) origin: Server: openresty

Date
The value of the Date header is the current time of the EdgeOne node server. For more information, please refer to
Date.
For instance: Date: Sat, 07 Jan 2023 14:15:52 GMT .

Connection
This header indicates how a persistent connection is handled during the communication between the client andserver. By default, this header follows the origin response (if exists). Otherwise, EdgeOne sets the header based on
the following rules:
HTTP/2 and QUIC requests: This header is not added.
HTTP 1.0 requests w/o KeepAlive option: The header is set to Connection:close .
**Origin response does not contain content-length and transfer-encoding **: This header is set toConnection:close .
In other cases, the header is set to Connection:keepalive .
For more information, see Connection.

Alt-Svc
Alt-Svc stands for Alternative-Service . It lists the alternative access methods of the site. This header iscommonly used for backward compatibility with previous protocols after updating to a new one, such as QUIC. If you
enable HTTP/3 (QUIC) for a domain name, this header is added to the HTTP response header by default. For more
information, see Alt-Svc.

EO-LOG-UUID
It carries the unique identifier of the request. When an access exception occurs, you can locate the problem byquerying logs with this UID.
Example: EO-LOG-UUID: 4105283880544427145 .

©2013-2022 Tencent Cloud. All rights reserved.

Page 245 of 245