Edge Security Acceleration (ESA) provides features such as network access and origin pull optimization, IPv6 support, WebSocket and gRPC connections, as well as settings for a maximum upload size. This topic describes how to configure these features.
IPv6
IPv6 support for ESA
Most ESA points of presence (POPs) support IPv6. After you enable IPv6, clients in an IPv6 environment can send IPv6 requests to the nearest ESA POPs that support IPv6. If the nearest ESA POPs do not support IPv6, the clients can send IPv4 requests instead.
Set up IPv6
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, go to Speed and Network > Optimize > Network Optimization.
In the IPv6 section, click Configure, turn on Status, and select Chinese Mainland or Global for Location.
NoteAfter IPv6 is enabled, IPv6 addresses of only clients in the specified location can be resolved.
WebSocket
What is WebSocket
WebSocket is a TCP-based protocol that implements persistent and full-duplex communications between a client and a server. It also allows the server to proactively send information to the client. Before the rise of WebSocket, web applications duplex achieve communications by continuously sending HTTP requests. This reduces service efficiency and increases costs.
WebSocket requires only one handshake between the client and the server to establish a persistent connection and implement bidirectional data transmission. This saves server resources and bandwidth, and ensures communications in real time.
Scenarios
Live commenting
User A posts a comment from a mobile phone and wants to view live comments from other clients on the phone. To meet this requirement, WebSocket is used to push the live comments from other clients to the mobile phone of User A. This way, User A can view the live comments sent by other users.
Online education
In the one-to-many online education scenario, WebSocket can be used to push the notes and syllabuses edited on the client of the teacher to the clients of the students in real time.
Real-time quotes for financial products
Constantly changing stock and gold prices can be pushed to clients around the world in real time over the WebSocket protocol. This facilitates financial decision-making in trading.
Live sportscasts
Live sportscasts are the top concern of a large number of sports fans all over the world. WebSocket satisfies the requirements of these sports fans by providing real-time sports updates.
Video conferencing
Video conferencing is adopted in a wide range of scenarios. In a video conference, participants join the conference from multiple devices. WebSocket helps deliver real-time information to these participants.
Location-aware applications
An increasing number of developers apply the GPS capabilities of mobile devices to location-aware applications. Based on the physical user location that is continuously updated, the location-aware applications can provide tailored offerings and information to users.
Before you begin
ESA WebSocket supports only ports 80 and 443.
When ESA is used to accelerate Websocket requests, the origin fetch timeout is equal to the setting of Timeout for HTTP requests to origin in Origin rules. A keep-alive mechanism must be implemented between your client and the origin server if you want to keep their connection available for a long time without data transmission.
Set up WebSocket
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, click Speed and Network, and choose the Network Optimization tab.
Turn on or off the WebSocket switch based on your business requirements. By default, the switch is on. For more information about how to configure an origin port for WebSocket, see Configure origin protocol and port.
NoteThe current configuration takes effect on all domain names of the website. If you want to enable WebSocket for only a specified domain name, add a rule for the domain name.
gRPC
Why use gRPC
Efficient communication: gRPC can improve communication efficiency and performance by using the multiplexing feature of HTTP/2.
Cross-language interoperability: gRPC supports multiple mainstream programming languages and allows the server and the client to use different languages for development. This facilitates the construction of heterogeneous systems.
Strongly typed interface definition: gRPC provides strict type checks and uses Protobuf to define your service interface and message structure. This helps reduce errors and simplify version management.
Stream processing: gRPC supports unidirectional and bidirectional streaming RPC and is an ideal choice for big data stream and real-time messaging scenarios.
High security: gRPC can be integrated with Transport Layer Security (TLS) to support multiple identity verification and authorization mechanisms for communication security.
Before you begin
The SSL/TLS feature is enabled and the certificate is correctly configured for the website. For more information, see Configure edge certificates.
TLS, HTTP/2, and gRPC are supported by the origin server, and Match Client or HTTPS is specified for the Origin Protocol parameter. For more information, see Origin certificates.
application/grpc
is used as the Content-Type header of gRPC requests.
Set up gRPC
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, click Speed and Network, and choose the Network Optimization tab.
Turn on the gRPC switch.
NoteThe current configuration takes effect on all domain names of the website. If you want to enable gRPC for only a specified domain name, add a rule for the domain name.
Maximum upload size
Scenarios
Large file upload: In scenarios such as online video uploading, large game distribution, and big data analysis, users may want to upload files whose size exceeds the file size that the server can process. To ensure the successful upload of such files, you can specify a larger upper limit.
Protection against malicious upload: For business that requires frequent user interactions, such as social media, forums, and blogs, malicious users may upload large files to consume server resources or launch attacks. To prevent potential risks and improve user experience, you can specify a small upper limit.
Traffic saving: For traffic-sensitive business, such as online education, online conferencing, and API services, the upload of large files may consume a large amount of traffic and thus increase costs. To prevent unnecessary transmission traffic and save costs, you can specify a small upper limit.
Set a maximum upload size
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, click Speed and Network, and choose the Network Optimization tab.
In the Maximum Upload Size section, click Configure and configure the Upper Limit parameter. By default, the Upper Limit parameter is set to 300 MB. You can specify a custom value that ranges from 100 MB to 500 MB.
Click OK.
After you configure this feature, ESA returns the HTTP 413 status code if a file to be uploaded exceeds the specified limit.
NoteThe current configuration takes effect on all domain names of the website. If you want to configure the Maximum Upload Size feature for only a specified domain name, add a rule for the domain name.
Access Optimization (Chinese Mainland Network)
Why use it
Assume that your web server is deployed outside the Chinese Mainland and uses websites outside the Chinese Mainland to provide services for global users. The access experience of users within the Chinese Mainland is poor and access failures may occur in some regions due to the high latency, high packet loss rate, and jitter of network links between regions within and outside the Chinese Mainland.
Access Optimization (Chinese Mainland Network) feature effectively resolves network issues for cross-region services based on regions such as the China (Hong Kong) region and Global Accelerator (GA) networks.
Set up the feature
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, click Speed and Network, and choose the Network Optimization tab.
Enable or disable this feature. By default, this feature is disabled.
Billing
Access Optimization (Chinese Mainland Network) is billed on a pay-as-you-go basis. After you enable the feature, you are charged for the outbound and inbound traffic generated in processing acceleration requests. For more information about the billing, contact your sales manager.
Availability
This feature is available in the Enterprise plan.