このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

Example Overview

Content Generation

Title
Example Introduction
Validates the request header and value. Responds if the validation is passed, and rejects if not.
Generates a JSON object and responds to the client with it.

Access Control

Title
Example Introduction
Validates the request header and value. Responds if the validation is passed, and rejects if not.
Calculates the SHA-256 signature of the request body and compares it with the signature generated by the origin server. If they are consistent, it indicates that the content has not been tampered with; otherwise, a 416 status code is returned for response.
Controls the permissions for .m3u8 and .ts fragment resources.
Implements custom access control based on the Referer request header.
Forwards the request to a specified remote authentication server. Allows access if the validation is passed and denies if not.
Uses the Web Crypto API to implement HMAC-SHA256 signature and stores the signature information in the request header, to complete data integrity check or identity authentication in cooperation with the origin server.

Redirect

Title
Example Introduction
Implements an automatic redirect to the target URL of the client region.
Implements an automatic and permanent 301 redirect of client requests to the preset website address.
Through the predefined redirect mapping table, implements an automatic redirect of specific paths to corresponding URLs.

Obtaining Client Information

Title
Example Introduction
Obtains the client IP address through the rule engine and responds to the client.
Based on the incoming HTTP request, returns the detailed information of the request URL as an HTML page.

Geo Location

Title
Example Introduction
Provides customized content based on the country where the client is located.
Responds with the client geo location information, including ASN, country name, country code, region name, region code, city name, longitude, and latitude.

Image Processing

Title
Example Introduction
Implements adaptive scaling based on the User-Agent request header.
Implements automatic format conversion to WebP based on the Accept request header.

Header Processing

Title
Example Introduction
Customizes the response headers by adding, modifying, and deleting.
Modifies the Content-Disposition information in the response header to change the name of the downloaded file based on the fileName parameter in the request URL.

Cache

Title
Example Introduction
Obtains remote resources through the Fetch API and caches resources to EdgeOne edge nodes through the Cache API.
Calculates an SHA-256 signature as the cache key for the POST request body and caches it to an edge node using the Cache API.

Responding in Streaming Mode

Title
Example Introduction
Obtains remote resources and responds to the client in streaming mode.
Remotely obtains multiple video resources for reading and concatenation in streaming mode, and then responds to the client.

Fetch

Title
Example Introduction
Obtains remote resources through the Fetch API and responds to the client.

Cookie

Title
Example Introduction
Obtains remote resources through the Fetch API and responds to the client.

Testing

Title
Example Introduction
Saves session information through Cookies and performs A/B testing on requests.