This topic provides an overview of origin fetch and its application scenarios.

What is origin fetch?

If a client requests resources that are not cached on Dynamic Route for CDN (DCDN) nodes, the request to retrieve the resources is redirected to the origin server. This process is called origin fetch. Static resources are cached on edge nodes, but dynamic resources are directly returned to the client. If you run a prefetch task on edge nodes, the edge nodes retrieve resources from the origin server and cache the resources. You can configure origin fetch based on your business requirements.

Scenarios

Origin fetch helps you manage domain names in the following scenarios.
Feature Description Reference
Specify a server domain name for origin fetch If the IP address of your origin server is associated with multiple domain names or sites, you can modify the HOST header in HTTP requests to specify the site to which requests are redirected. DCDN redirects requests to the site that is specified by the HOST header. Configure the origin host
Set the origin protocol policy If a client requests resources that are not cached on edge nodes, DCDN redirects the request to the origin server over the protocol that is specified by the origin protocol policy. You can set the origin protocol policy to Match Client, HTTP, or HTTPS. Configure the static origin protocol policy
Retrieve content from private Object Storage Service (OSS) buckets If your origin server is a private Object Storage Service (OSS) bucket, you must enable the private bucket origin feature and grant DCDN permissions to access the OSS bucket. Permission control can prevent hotlinking. Configure private bucket origin
Specify a site for origin fetch If edge nodes access your origin server over HTTPS and the IP address of the origin server is associated with multiple domain names, you can configure Server Name Indication (SNI) to specify the domain name that edge nodes can access. Configure origin SNI
Validate client requests and reject requests that are not in the whitelist to access the origin server When DCDN nodes connect to origin servers over HTTPS, the system compares common names in the certificates that are returned by the origin servers with the SNI values included in client requests. If an SNI value that is included in the client request does not match the common name in the certificate that is returned by the origin server, the client request is rejected. Configure a common name whitelist
Return partial content within the specified range from the origin server You can enable Range Origin Fetch to accelerate the delivery of large files. This reduces the usage of back-to-origin data transfer and shortens the resource response time. Configure range origin fetch
Specify a maximum timeout period for back-to-origin requests You can configure the amount of time that an edge node waits for a response after a request is redirected to the origin server. The default timeout period is 30 seconds. If the edge node does not receive a response within the specified timeout period, the connection between the edge node and origin server closes. Configure a timeout period for origin fetch requests
Add, modify, or delete an HTTP header from back-to-origin requests You can add HTTP headers to or delete HTTP headers from back-to-origin HTTP requests. Customize an origin HTTP header