What is caching?
When you use DCDN to accelerate static resources, DCDN 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, DCDN requests the latest data from the origin server.
Caching features
DCDN supports the following caching features.
|
Feature |
Description |
|
Cache expiration rules control how long resources are cached on DCDN points of presence (POPs), which lets you balance content freshness, access performance, and origin fetch costs. This topic describes how cache rules work, how to configure and verify them, and how to troubleshoot caching issues, and it provides best practices for production environments. |
|
|
When a DCDN node fetches a resource from the origin server, the origin server returns a response status code. You can configure a cache duration for status codes in Alibaba Cloud DCDN. When a client requests the same resource again, DCDN returns the status code directly without triggering an origin fetch, which reduces the load on the origin server. When the configured cache duration expires, an origin fetch is triggered again. |
|
|
Outbound response headers are one of the components of HTTP response message headers. They can carry specific response parameters and pass the parameters to clients, and can be used to control various types of client behavior, such as cache behavior, cross-origin access, content types, and download methods. By modifying outbound response headers, when users request resources under an accelerated domain name, the response message returned by DCDN carries the response headers that you configured, which enables specific features such as cross-origin access. |
|
|
After you create a custom error page, if the requested content does not exist or an error occurs, points of presence (POPs) return the custom error page instead of the default error page, improving user experience with clear, actionable feedback. |
|
|
When a resource on the origin server is relocated, Dynamic Content Delivery Network (DCDN) points of presence (POPs) rewrite outdated request URLs and redirect them to the new path. This reduces back-to-origin requests and improves access performance. |
|
|
Custom cache key rules generate cache keys from specific parts of an HTTP request, such as the URI, request parameters, HTTP headers, or custom variables. By consolidating requests for the same resource into a uniform cache key, this feature improves cache hit ratios, reduces origin fetches, and lowers response times and bandwidth consumption. |
|
|
After adding your domain to Alibaba Cloud DCDN, you can configure custom HTTP response headers to enable cross-origin resource sharing (CORS) and access resources from different origins. |
For dynamic requests, you can ignore the request hit ratio or byte hit ratio due to the following reasons:
-
Data between the client and DCDN POPs is transmitted over HTTP/2, which supports header compression. Back-to-origin requests are sent over HTTP. The traffic of back-to-origin requests must be more than that of edge access requests.
-
By default, DCDN POPs add headers that mark DCDN information to back-to-origin requests. The headers also increase the size of back-to-origin requests.
In both cases, a small amount of byte hit data exists and can be ignored.