All Products
Search
Document Center

CDN:Cache overview

Last Updated:Mar 06, 2026

When Alibaba Cloud Content Delivery Network (CDN) accelerates the delivery of static resources to a user, CDN caches the resources on the point of presence (POP) that is nearest to the user. When the resource is requested again, the POP directly returns the cached resource to the user without redirecting the request to the origin server. If the resource that is requested by the user does not exist on the POP or has expired, the POP retrieves the latest data from the origin server.

Related features

The following table describes the operations that you can perform on a domain name by using the caching feature.

Feature

Description

Configure CDN cache expiration time

Time-to-live (TTL) is the amount of time that a resource is cached on CDN points of presence (POPs). When the TTL of a cached resource ends, the resource on the POPs expires. Requests that attempt to access expired resources are redirected to the origin server. The retrieved resources are returned to the clients and cached on the POPs. You can create a cache rule for resources based on file directories or file name extensions.

Configure status code TTL

When an Alibaba Cloud Content Delivery Network (CDN) point of presence (POP) fetches a resource from your origin server, the origin server returns a response status code. You can configure a cache duration for these status codes in CDN. When a client requests the same resource again, the CDN POP returns the status code directly without performing an origin fetch. This reduces the load on your origin server. When the cache duration for the status code expires, a new origin fetch is triggered.

Configure TTL for status codes (honor origin)

You can use this feature to set the time-to-live (TTL) of static resources on CDN points of presence (POPs) based on the status codes of origin responses.

Configure an outgoing response header

The outgoing response headers are a component of the header section in response messages that are transmitted over HTTP. HTTP response headers deliver specific parameters to clients to manage caching. You can configure outgoing response headers and allow Alibaba Cloud CDN to return the configured response headers. This way, specific features, such as cross-origin resource sharing (CORS), can be implemented.

Create a custom error page

After you create a custom error page, when the requested content does not exist or an error occurs, the point of presence (POP) returns the custom error page instead of the default error page. A custom error page improves user experience and allows users to view more user-friendly error prompts.

Create an access URL rewrite rule

If the directory of a resource on the origin server changes, the directory of the resource on points of presence (POPs) also changes. If the request URL to the resource does not change, POPs need to rewrite the request URL and redirect the request to the destination path. This reduces the number of origin requests and improves client access performance.

Custom Cache Key

Allows you to set a cache key for a type of request that is destined for the same resource file. This can help you save the cache space and reduce the number of requests redirected to the origin server.

You can configure custom cache keys by creating rules that generate cache keys based on different parts of an HTTP request, such as the URI, request parameters, HTTP request headers, or custom variables. This feature converts requests for the same file into a single cache key, which prevents the same request from being cached as different files. As a result, this improves the cache hit rate, reduces origin fetches, and decreases response times and bandwidth consumption.

Configure cache sharing

After you configure cache sharing, accelerated domain names in the same Alibaba Cloud account can share resources that are cached on Alibaba Cloud CDN points of presence (POPs). If origin servers of different domain names store a large number of common resources, such as images, CSS files, and JavaScript files, you can configure cache sharing. This way, the domain names can share the common resources to reduce the bandwidth usage and increase the resource hit ratio for the domain names. This improves the acceleration performance of Alibaba Cloud CDN and reduces origin traffic.

Configure cross-origin resource sharing

After you add your service to Alibaba Cloud CDN, you can configure HTTP response headers to enable cross-origin access to your resources.

FAQ