All Products
Search
Document Center

CDN:Origin fetch

Last Updated:Dec 17, 2025

An origin fetch occurs when a client requests a resource that is not cached on a CDN point of presence (POP), or when a prefetch task is deployed. The CDN POP then retrieves the resource from the origin server. You can configure origin fetch settings as needed.

How it works

  1. When a user visits a website, a client, such as a browser, sends a request to a CDN POP. The request URL points to the CDN accelerated domain name.

  2. The CDN POP checks its cache for the requested resource. If the resource is cached, the POP returns it directly to the client.

  3. If the resource is not cached, the CDN POP sends an origin request to the origin server based on the configured origin policies.

  4. After the origin server receives the request, it returns the resource based on the URL and parameters.

  5. After the CDN POP retrieves the resource, it caches the resource for subsequent requests.

  6. The CDN POP returns the resource to the client. This completes the request.

Features overview

Feature category

Feature

Description

Related links

Origin fetch from private OSS buckets

Origin fetch from private OSS buckets

If your origin server is Alibaba Cloud Object Storage Service (OSS) and the access control list (ACL) of the bucket is set to private, you must grant CDN the required access permissions. This allows CDN POPs to fetch resources from the bucket.

Origin fetch from private OSS buckets

Origin requests

Origin protocol

Specifies the protocol that CDN POPs use for origin fetch. You can set the protocol to HTTP, HTTPS, or Follow. The Follow option uses the same protocol as the client request.

Configure the origin protocol

Origin HOST

The origin HOST specifies the site on the origin server that an origin request accesses. If multiple websites are hosted on the same origin server, configure the origin HOST to ensure that CDN POPs retrieve the correct resources. You can configure a global default HOST or specify different HOSTs for different origin servers.

Origin URL

If the resource path on the origin server changes but the client access URL must remain the same, use the origin URL rewrite feature. When a POP fetches a resource, it rewrites the requested URL path to the new path based on the configured rules.

Rewrite origin URLs

Origin parameters

Configure rules to rewrite the request parameters in an origin URL. You can delete all parameters, keep specific parameters, or delete specific parameters.

Rewrite origin parameters

Origin request header

Customize the HTTP request headers that POPs send during origin fetch. You can add, modify, or delete header fields. This feature is often used to pass custom information to the origin server, such as user information or request source.

Modify outgoing request headers

Origin SNI and Common Name

If the origin protocol is HTTPS, configure the origin Server Name Indication (SNI) to specify the server domain name that the POP requests during the TLS handshake. This feature is useful when multiple HTTPS sites with different certificates are hosted on the same origin IP address.

You can also enable the Common Name whitelist. This makes the POP verify that the Common Name or Subject Alternative Name in the origin certificate matches the specified SNI, which enhances origin fetch security.

Origin response

Modify origin response headers

Configure rules to add, modify, or delete HTTP response headers received from the origin server before the POP sends the resource to the client. For example, add cross-domain response headers such as Access-Control-Allow-Origin.

Modify incoming response headers

301/302 redirect

If the origin server returns a 301 or 302 status code, configure POPs to request resources from the redirected address on behalf of the client. This reduces the number of client requests.

Configure 301/302 redirect

Other features

Timeout period

Set the maximum wait time for a POP to establish a connection with the origin server and receive data. If the origin server does not respond or the data transfer is not complete within this period, the POP disconnects and returns a 5xx error to the client. A reasonable timeout period helps fail fast and prevents long client wait times.

Configure the origin HTTP request timeout

Advanced origin

If you have multiple origin servers and need to route different requests to different origins, use the advanced origin feature. Advanced origin can route requests to a specified origin server based on conditions such as request parameters or client IP addresses.

Advanced origin

Origin fetch over IPv6

If your origin server supports IPv6, enable origin fetch over IPv6. After you enable this feature, POPs will prioritize using the IPv6 protocol to access the origin server. You can configure automatic fallback to IPv4 if IPv6 origin fetch fails to ensure service availability.

Configure origin fetch over IPv6