All Products
Search
Document Center

CDN:Overview

Last Updated:Mar 13, 2024

If a client requests resources that are not cached on points of presence (POPs), the request is redirected to the origin server to retrieve the resources. If you submit a prefetch task, the POPs retrieve resources from the origin server. This process is called origin fetch. You can configure origin fetch settings based on your business requirements.

How it works

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

  2. The POP checks whether the requested resource exists in the cache. If the resource exists, the POP returns the cached resource to the client. This accelerates content delivery.

  3. If the requested resource does not exist in the cache of the POP, the POP initiates an origin fetch request based on the configured origin fetch policy.

  4. After the origin server receives the origin fetch request from the POP, the origin server returns the requested resource based on the request URL and parameters.

  5. After the POP retrieves the resource from the origin server, the POP caches the resource. This way, the cached resource can be directly returned for subsequent requests.

  6. The POP returns the retrieved resource to the client.

Scenarios

Scenario

Description

References

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 configure the HOST header in requests to specify the site to which requests are redirected. Alibaba Cloud CDN redirects requests to the site that is specified by the HOST header.

Configure the default origin host

Specify the origin host for each origin server

If an accelerated domain name is associated with multiple origin servers and you want to retrieve resources from different virtual sites based on the value of the HOST header, you can specify the origin host for each origin server.

Specify the origin host for each origin

Specify the origin protocol policy

Alibaba Cloud CDN follows the protocol specified by the origin protocol policy to retrieve resources from an origin server. After you configure the origin protocol policy, points of presence (POPs) redirect requests based on the origin protocol policy. You can configure custom HTTP and HTTPS ports.

Configure the origin protocol policy

Retrieve content from private OSS buckets

If your origin server is a private Object Storage Service (OSS) bucket, you must grant Alibaba Cloud CDN access permissions on private OSS buckets before POPs can access the buckets. Permission control can prevent hotlinking.

Configure access to private OSS buckets

Specify a site for origin fetch

If POPs access your origin over HTTPS and the IP address of the origin server is associated with multiple domain names, configure Server Name Indication (SNI) to specify the domain name that you want the POPs to access.

Configure SNI

Configure the Common Name whitelist

After you enable the Common Name whitelist feature, the certificate Common Name returned by the origin server and the SNI value included in an HTTPS request are verified when a POP establishes a connection with the origin server over HTTPS.

Common Name whitelist

Specify the maximum timeout period for origin fetch requests

You can specify the maximum amount of time that a POP waits for a response after a request is redirected to the origin server. If the POP does not receive a response within the specified timeout period, the connection between the POP and the origin server closes.

Configure a timeout period for back-to-origin HTTP requests

Redirect requests to different origin servers based on the request parameters

You can configure advanced origin settings to redirect requests to different origin servers based on the request header, query string parameter, path, and request cookie.

Configure advanced origin settings

Enable or disable 302 redirection

If 301/302 redirection is enabled on POPs and the origin server returns the HTTP 301 or 302 status code, the POPs process the status code instead of directly returning it to clients.

Configure 301/302 redirection

Configure origin fetch over IPv6

After you configure origin fetch over IPv6, POPs can redirect requests to origin servers over IPv6 based on different origin fetch policies, such as redirecting requests to origin servers that use IPv6 addresses, using the IP version of the client request, and load balancing between IPv4 and IPv6 addresses.

Configure origin fetch over IPv6

Add, rewrite, or remove an HTTP request header

You can rewrite HTTP headers before requests are redirected to origin servers.

Configure HTTP request headers

Add, rewrite, or remove an HTTP response header

You can rewrite HTTP headers in responses from an origin server.

Configure HTTP response headers

Rewrite origin URLs

If a resource on the origin server relocates, the URL of the resource changes. When user requests use the original URL, Alibaba Cloud CDN must rewrite the URL so that the requests can be redirected to the new URL.

Rewrite origin URLs

Rewrite parameters in origin URLs

Alibaba Cloud CDN allows you to rewrite URL parameters in requests before the requests are redirected to origin servers. You can ignore, add, delete, retain, and modify parameters.

Parameter rewrite