Edge Function APIs process incoming requests at the nearest points of presence (POPs) to your users, reducing latency and improving response speed for a better user experience.
The following list introduces Edge Function APIs:
The common functions supported by Edge Function.
Use the Fetch APIs to fetch data from POPs over HTTP or HTTPS and return the data to users. It is similar to the Fetch APIs in the browser environment and can be used in scenarios such as dynamic loading of content, interaction with backend services, and A/B testing.
Use the Stream APIs to process streaming data such as audio and video on POPs. Moreover, the Stream APIs can transmit streaming data in chunks to accelerate data transmission.
Use the HTMLStream APIs to process HTML streaming data on POPs, such as real-time stock data or chat records. Moreover, with the HTMLStream APIs, you can transmit HTML streaming data in chunks to accelerate data transmission.
Use the Cache APIs to cache data on POPs so that data can be served quickly for subsequent requests. In a Cache API, you can configure the time to live (TTL) and cache size based on your business requirements.
Other supported API operations:
Other APIs supported by Edge Function such as
URL,URLSearchParams, andTextDecoder.Built-in Edge KV APIs such as
Constructor,get, anddelete.