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.
How it works
Alibaba Cloud CDN works differently based on whether you configure cache sharing for domain names, such as a.example.com
and b.example.com
.
For example, the domain names use the same Bootstrap framework and reference the same images, CSS files, and JavaScript files.
Cache sharing not configured
Cache sharing configured
Same origin URL
If
a.example.com
andb.example.com
are hosted on the same originorigin.example.com
, requests for the two domain names are retrieved from the same origin server regardless of whether you configure cache sharing.The origin URLs are the same. The domain names can share the cache. This accelerates content delivery.
Different origin URLs
Assume that the origin domain of
a.example.com
isorigin-a.example.com
and the origin domain ofb.example.com
isorigin-b.example.com
. If resource URLs are the same, and the accelerated domain name is replaced with the domain name that shares the cache when the cache key is generated, the same cached content can be returned even when the origin URLs are different. The domain names can share the cache. This accelerates content delivery.If the origin URLs are different and resource URLs are the same, the resources are considered the same based on the cache key. This accelerates content delivery.
Usage notes
You can configure cache sharing for only domain names in the same Alibaba Cloud account.
If you remove an accelerated domain name for which cache sharing is configured, the hit ratios of other accelerated domain names that share the cache with the domain name are affected. After you configure cache sharing for a domain name, disable or remove domain names that share the cache with caution. For example, if you configure cache sharing for Domain Name A to share the cache with Domain Name B, the system does not allow you to remove Domain Name B. You need to delete the cache sharing configurations of Domain Name A or configure Domain Name A to share the cache with another domain name before you remove Domain Name B.
If you transfer an accelerated domain name for which cache sharing is configured, the shared cache of the domain name is not affected.
After you configure cache sharing for an accelerated domain name, the accelerated domain name is replaced with the domain name that shares the cache only when you query or generate a cache key. The origin URL and origin host of the accelerated domain name remain the same.
Procedure
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
In the left-side navigation tree of the domain name, click Cache.
Click the Cache Sharing tab.
Click Configure.
In the Cache Sharing dialog box, select a domain name and click OK.