Edge Security Acceleration (ESA) provides features for network access and origin fetch optimization, IPv6 support, WebSocket and gRPC connections, and maximum upload size settings. This topic describes how to configure these features.
Enable the IPv6 protocol
Internet Protocol Version 6 (IPv6) is the sixth version of the Internet Protocol. It was developed to address the exhaustion of IPv4 addresses and to meet the optimization needs of modern networks.
Use cases
Most ESA points of presence (POPs) accept requests over the IPv6 protocol. After you enable IPv6, if your users are in an IPv6 environment and the nearest POP supports IPv6, clients can access the POP over the IPv6 protocol. If the nearest POP does not support the IPv6 protocol, clients can still access the POP over the IPv4 protocol.
Procedure
In the ESA console, select Websites, and in the Website column, click the target site.
In the navigation pane on the left, choose .
Select the Network Optimization tab. In the IPv6 section, click Configure. Turn on the Status switch. Set Location to Chinese Mainland or Global based on the region of your clients. Click OK.
NoteAfter you enable IPv6, an IPv6 address is resolved only when a client from the specified region sends an access request.

Enable WebSocket
The WebSocket protocol is a persistent protocol based on TCP. It enables full-duplex communication between a client and a server, which allows the server to proactively send information to the client. Before WebSocket, web applications that required duplex communication had to constantly send HTTP requests to poll for data. This process was inefficient and costly. With WebSocket, the client and server only need to perform a single handshake to establish a persistent connection for two-way data transmission. This mechanism saves server resources and bandwidth, and enables real-time communication.
Use cases
Live comment: When a user sends a live comment from their mobile phone, their phone must also display all live comments from other clients. The WebSocket protocol is used to push all live comments from the server to the user's phone. This allows the user to see their own comment and comments from other users simultaneously.
Online education: When a teacher conducts a one-to-many online class, notes and annotations made on the teacher's client must be pushed to multiple students' clients in real time. The WebSocket protocol can be used for this purpose.
Real-time quotes for stocks and other financial products: The prices of assets such as stocks and gold change rapidly. After a price changes, the WebSocket protocol can push the updated price to clients worldwide in real time. This allows traders to make quick trading decisions.
Live sports updates: Live coverage of sports events is a major point of interest for many sports fans worldwide. For this type of news, real-time updates using WebSocket provide the best user experience.
Video conferencing and chat: WebSocket technology can support real-time information exchange among multiple participants in a meeting or chat session.
Location-based applications: More and more developers are using the GPS function of mobile devices to create location-based web applications. For example, continuously recording an end user's location, such as an exercise route recorded by an app, lets you collect more detailed data in real time.
Before you start
ESA supports WebSocket only on ports 80 and 443.
When you use ESA to accelerate WebSocket requests, the origin fetch timeout must be the same as the Timeout for HTTP requests to origin set in the Origin rules. If you want the WebSocket connection between the client and the origin server to remain active for a long time, even when no data is being transferred, you need to implement a heartbeat keepalive mechanism between the client and the origin server.
Procedure
In the ESA console, select Websites, and in the Website column, click the target site.
In the navigation pane on the left, choose .
Select the Network Optimization tab. In ESA, WebSocket is enabled by default. You can enable or disable it as needed. To configure a separate origin port for WebSocket, see Configure origin protocol and port.
NoteThis configuration applies to all domain names under the site. If you want to enable the WebSocket feature for a specific domain name only, add a rule for that domain name. For more information, see Network optimization rules.

Establish a gRPC connection
gRPC is a high-performance remote procedure call (RPC) framework based on HTTP/2. It improves communication efficiency through multiplexing, supports cross-language interoperability, and uses Protocol Buffers for strongly-typed interface definitions. gRPC provides unidirectional and bidirectional streaming capabilities and integrates TLS encryption and identity verification mechanisms. It is suitable for building secure, real-time, and heterogeneous distributed applications.
Use cases
Efficient communication: gRPC uses the multiplexing feature of HTTP/2 to improve communication efficiency and performance.
Cross-language interoperability: gRPC supports multiple mainstream programming languages. This allows the server and client to be developed in different languages, which makes it easier to build heterogeneous systems.
Strongly-typed interface definition: gRPC uses Protocol Buffers to define service interfaces and message structures. This provides strict type checking, which helps reduce errors and simplify version management.
Streaming: gRPC supports unidirectional and bidirectional streaming RPCs. This is especially suitable for scenarios that involve large data streams and real-time message interaction.
Security: gRPC can be integrated with TLS encryption to ensure communication security. It also supports multiple identity verification and authorization mechanisms.
Before you start
Ensure that you have enabled and correctly configured an SSL/TLS edge certificate for your site.
Ensure that your origin server supports the TLS, HTTP/2, and gRPC protocols. In the origin protocol and port settings, set Origin Protocol to Match Client or HTTPS.
In Modify Outbound Request Headers, set the
Content-Typerequest header toapplication/grpcto process gRPC requests.
Procedure
In the ESA console, select Websites, and in the Website column, click the target site.
In the navigation pane on the left, choose .
Select the Network Optimization tab and turn on the gRPC switch.
NoteThis configuration applies to all domain names under the site. If you want to enable the gRPC feature for a specific domain name only, add a network optimization rule for that domain name.

Set the maximum upload size
Adjusting the maximum upload size limit helps you manage large file uploads, defend against malicious attacks, and control traffic costs. By setting an appropriate limit, you can adapt to business needs and optimize resources.
Use cases
Large file uploads: For services that involve uploading large files, such as online video platforms, large game distribution, and data analytics, users may need to upload files that exceed the server's processing capacity. In this scenario, you can increase the upload size limit to ensure that large files can be uploaded successfully.
Defense against malicious uploads: For services with frequent user interaction, such as social media, forums, and blogs, malicious users might try to upload oversized files to consume server resources or launch attacks. In this case, you can lower the limit to prevent such uploads. This reduces server load, mitigates potential security risks, and improves user experience.
Save transmission traffic: For traffic-sensitive services, such as online education, online meetings, and API services, large uploaded files can consume significant bandwidth and increase costs. To save bandwidth, you can set a smaller upload limit to reduce unnecessary data transmission and lower traffic costs.
Procedure
In the ESA console, select Site Management, and click the Site Name or Details in the Actions column.
In the navigation pane on the left, choose .
Select the Network Optimization tab. In the Maximum Upload Size section, click Configure and set the Upper Limit.
The default value is 300 MB. You can change this value. The valid range is 100 MB to 500 MB.
Click OK to complete the configuration.
After the configuration is complete, if a user uploads a file that exceeds the specified size limit, ESA returns a 413 status code to the client.
NoteThis configuration applies to all domain names under the site. If you want to set maximum upload size for a specific domain name only, add a network optimization rule for that domain name.
Access Optimization (Chinese Mainland Network)
ESA provides a feature that optimizes network access for the Chinese mainland. This feature uses ESA POPs and the ESA network in regions such as China (Hong Kong) to improve performance when users in the Chinese mainland access origin servers outside the Chinese mainland.
The Access Optimization (Chinese Mainland Network) feature is a paid add-on for the Enterprise plan that uses the pay-as-you-go billing method. After you enable this feature, you are charged for the upstream and downstream traffic of accelerated requests. For more information about billing, contact customer service.
Only sites whose acceleration region is Global (Excluding the Chinese Mainland) can use Access Optimization (Chinese Mainland Network). If your acceleration region does not meet this requirement, see Switch the acceleration region of a site.
Use cases
If your web service is deployed outside the Chinese mainland and you use a site whose acceleration region does not include the Chinese mainland to serve global users, users in the Chinese mainland may experience poor access performance. This is due to issues such as high latency, a high packet loss rate, and jitter on network links between the Chinese mainland and other regions. In some areas, access may even fail.
After a request from a user in the Chinese mainland reaches an ESA POP, the Access Optimization (Chinese Mainland Network) feature selects the optimal POP to handle the request based on the origin server's location. If the origin server is located outside the Chinese mainland, a POP in a region such as Hong Kong is used for origin requests to ensure a good experience.
Procedure
In the ESA console, select Websites, and in the Website column, click the target site.
In the navigation pane on the left, choose .
Select the Network Optimization tab. This feature is disabled by default. You can enable or disable it as needed.