When you use CDN to accelerate static resources, CDN caches the resources on the nearest POP. When you access a resource, you can retrieve it directly from the POP, which reduces latency and improves access efficiency. If the requested content does not exist on the POP or has expired, CDN requests the latest data from the origin server.
Cache-related features
Use the following features to control the caching behavior for your accelerated domain names.
Feature | Description |
By configuring cache expiration rules, you can precisely control the cache duration for resources on CDN points of presence (POPs) to balance content freshness, access performance, and origin-fetch costs. This document explains how cache rules work, how to configure and validate them, and provides troubleshooting guidance and best practices. | |
When a CDN or POP fetches a resource, the origin server returns a status code. You can configure a TTL for these status codes in Alibaba Cloud CDN or . When a client requests the same resource again, the POP can directly respond with the cached status code without an origin fetch. This reduces the load on your origin server. When the TTL for the status code expires, the next request triggers an . | |
This feature lets you set the time-to-live (TTL) for static resources on points of presence (POPs) based on the status codes that your origin returns. | |
Outgoing response headers are HTTP response components containing parameters that control client caching behavior. By modifying these headers, CDN includes your configured headers in responses to requests for your accelerated domain name. This allows you to implement features such as cross-origin resource sharing (CORS). | |
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. | |
If the resource path on the origin server changes, the corresponding resource path on a POP also changes. If a client requests the original URL, the POP can rewrite the request URL and redirect it to the new path. This process reduces origin-pull requests and improves client performance. | |
You can consolidate requests that access the same file into a single cache key. This prevents different requests from being cached as different files and reduces origin fetches. By configuring a custom cache key, you can define rules to generate a cache key based on different parts of an HTTP request, such as the URI, request parameters, HTTP request headers, or custom variables. This improves the cache hit ratio, reduces origin fetches, and decreases response time and bandwidth consumption. | |
Cache sharing allows multiple accelerated domain names under the same Alibaba Cloud account to share cached resources on CDN points of presence (POPs). When multiple domain names serve many common assets, such as images, CSS, and JavaScript files, configuring cache sharing prevents duplicate origin fetches. This improves the cache hit ratio and reduces origin traffic. | |
When a browser requests a resource from a different origin, it checks whether the server allows the cross-origin request. Alibaba Cloud CDN handles this by comparing the |
FAQ
How can I determine if content is successfully cached by CDN or DCDN?
How do I resolve a low cache hit ratio caused by variable URL query parameters?
How do I configure files to bypass the cache and be fetched directly from the origin server?
Why is the content not up-to-date even after I set the TTL to 0 in the CDN or DCDN console?
Are POP caches automatically and instantly updated after a file is modified on the origin server?
What factors can cause a low cache hit ratio for CDN and DCDN?
How do I set the server-side TTL when using CDN to accelerate static resources?
Why is the content served by CDN different from the content on the origin server?
Configure CORS for CDN by using HTTP response headers and notes
What are the cache rules for error and redirect status codes?
What is the difference between outgoing and incoming response headers?
Does CDN support multi-replica caching, and how do I implement it?
How do I configure CDN to serve a root document for a subdirectory?