Network optimization in Edge Security Acceleration (ESA) controls how your site handles protocols, connections, and uploads at the edge. You can configure IPv6 support, WebSocket and gRPC connections, maximum upload size limits, and cross-border access optimization for users in the Chinese mainland.
Enable IPv6
Internet Protocol Version 6 (IPv6) extends the address space beyond IPv4, supporting clients on both protocol versions. Most ESA points of presence (POPs) accept IPv6 requests. After you enable IPv6, DNS resolution returns an IPv6 address only when a client from the specified region sends a request.
Connection behavior
| Client type | POP support | Behavior |
|---|---|---|
| IPv6 client | IPv6-compatible POP | Connects via IPv6 |
| IPv6 client | IPv4-only POP | Falls back to IPv4 |
| IPv6-only client | IPv4-only POP | Connects via IPv4 |
Procedure
-
In the ESA console, go to Websites and click the target site in the Website column.
-
In the left navigation pane, choose Speed and Network > Optimization.
-
On the Network Optimization tab, in the IPv6 section, click Configure.
-
Turn on the Status switch.
-
Set Location to Chinese Mainland or Global based on where your clients are located.
-
Click OK.
After you enable IPv6, an IPv6 address is resolved only when a client from the specified region sends an access request.
Enable WebSocket
WebSocket establishes a persistent, full-duplex TCP connection between client and server, replacing repeated HTTP polling with a single handshake. This reduces connection overhead and supports real-time bidirectional data transfer.
The Entrance plan does not support WebSocket.
Use cases
| Use case | Description |
|---|---|
| Live comment systems | Stream real-time comments during live broadcasts |
| Online education | Synchronize instructor notes to student devices |
| Financial trading | Push real-time price updates |
| Video conferencing | Enable real-time communication among participants |
| Location tracking | Continuously report client location data |
Prerequisites
Before you enable WebSocket, make sure that:
-
Your application uses port 80 or 443. ESA supports WebSocket only on these ports.
-
The origin fetch timeout matches the timeout for HTTP requests to origin configured in the origin rules.
-
(Optional) A heartbeat keepalive mechanism is implemented between the client and origin server if the WebSocket connection must remain active during idle periods.
Procedure
-
In the ESA console, go to Websites and click the target site in the Website column.
-
In the left navigation pane, choose Speed and Network > Optimization.
-
On the Network Optimization tab, locate the WebSocket toggle. WebSocket is enabled by default. Toggle it off or on as needed. To configure a separate origin port for WebSocket, see Configure origin protocol and port.
This setting applies to all domain names under the site. To enable WebSocket for a specific domain name only, create a network optimization rule for that domain name.
Enable gRPC
gRPC uses HTTP/2 for high-performance remote procedure calls, supporting both unidirectional and bidirectional streaming through multiplexing. HTTP/2 multiplexing allows multiple concurrent requests over a single connection, reducing connection overhead.
Features
| Feature | Description |
|---|---|
| HTTP/2 multiplexing | Multiple concurrent requests over a single connection |
| Cross-language support | Works with multiple programming languages |
| Strong typing | Protocol Buffers provide type checking and version management |
| Streaming | Supports unidirectional and bidirectional streaming |
| Secure transport | Integrated TLS encryption and authentication |
Prerequisites
Before you enable gRPC, make sure that:
-
An SSL/TLS edge certificate is configured for your site
-
Your origin server supports TLS, HTTP/2, and gRPC
-
Origin Protocol is set to Match Client or HTTPS in the origin protocol and port settings
-
The
Content-Typerequest header is set toapplication/grpc
Procedure
-
In the ESA console, go to Websites and click the target site in the Website column.
-
In the left navigation pane, choose Speed and Network > Optimization.
-
On the Network Optimization tab, turn on the gRPC switch.
This setting applies to all domain names under the site. To enable gRPC for a specific domain name only, create a network optimization rule for that domain name.
Set the maximum upload size
Control the maximum file size that clients can upload through your site. Setting an appropriate limit helps manage large file uploads, protect against oversized payloads, and control bandwidth costs.
Use cases
| Scenario | Recommendation | Purpose |
|---|---|---|
| Large file services | Increase the limit (up to 500 MB) | Support video platforms and software distribution |
| Security hardening | Decrease the limit | Block oversized uploads |
| Traffic optimization | Adjust the limit to match your workload | Reduce unnecessary bandwidth consumption |
Procedure
-
In the ESA console, go to Websites and click the target site in the Website column.
-
In the left navigation pane, choose Speed and Network > Optimization.
-
On the Network Optimization tab, in the Maximum Upload Size section, click Configure.
-
Set the Upper Limit. The default value is 300 MB. Valid values: 100 to 500 MB.
-
Click OK.
After the configuration takes effect, ESA returns a 413 status code to any client that attempts to upload a file exceeding the limit.
This setting applies to all domain names under the site. To set the maximum upload size for a specific domain name only, create a network optimization rule for that domain name.
Access Optimization (Chinese Mainland Network)
ESA provides cross-border access optimization for users in the Chinese mainland who access origin servers deployed outside the Chinese mainland. This feature routes requests through ESA POPs in regions such as China (Hong Kong) to reduce latency and improve reliability.
-
Access Optimization (Chinese Mainland Network) is a paid add-on for the Enterprise plan that uses pay-as-you-go billing. After you enable this feature, you are charged for the upstream and downstream traffic of accelerated requests. For billing details, contact customer service.
-
Only sites with the acceleration region set to Global (Excluding the Chinese Mainland) can use this feature. To change your acceleration region, see Switch the acceleration region of a site.
When to enable this feature
Enable this feature when your origin server is located outside the Chinese mainland but your site serves users within the Chinese mainland. Without this optimization, those users may experience:
-
High latency
-
High packet loss rates
-
Network jitter
-
Complete access failures in some areas
After a request from a user in the Chinese mainland reaches a POP, ESA 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 China (Hong Kong) handles the origin fetch for a better experience.
Procedure
-
In the ESA console, go to Websites and click the target site in the Website column.
-
In the left navigation pane, choose Speed and Network > Optimization.
-
On the Network Optimization tab, locate the Access Optimization (Chinese Mainland Network) toggle. This feature is disabled by default. Turn it on to enable it.
Troubleshooting
| Symptom | What to check |
|---|---|
| IPv6 requests not resolving | Verify that the Location setting matches the regions where your clients are located. |
| WebSocket disconnections during idle periods | Confirm that a heartbeat keepalive mechanism is implemented at the application level. |
| gRPC connection failures | Verify that the SSL/TLS edge certificate is configured and that the origin server supports HTTP/2 and gRPC. |
| Upload rejected unexpectedly | Confirm that the configured maximum upload size is within the valid range (100 to 500 MB). |
| Cross-border access optimization not performing as expected | Confirm that the site acceleration region is set to Global (Excluding the Chinese Mainland) and that sufficient traffic is flowing through the optimized path. |
Site-level and rule-based feature mapping
Site-level settings apply to all requests under the site. To apply a feature to specific requests based on match conditions, use rule-based features.
| Site-level feature | Corresponding rule-based feature |
|---|---|
| WebSocket | WebSocket |
| gRPC | gRPC |
| Maximum Upload Size | Maximum Upload Size |
| Traffic Smart Routing | Smart Routing |