Content Delivery Network (CDN) can be used to accelerate mass download/deliver content stored in a COS bucket, which is ideal when the same content needs to be downloaded repeatedly. The origin-pull authentication feature allows CDN to accelerate the delivery of content stored in a private-read bucket. The CDN authentication feature allows only the authorized users to download content, helping avoid data security risks and unnecessary traffic costs.
Note:After you enable the CDN acceleration domain name, data downloads and access through it will generate CDN origin-pull traffic and CDN traffic. For more information, see Traffic Fees.
CDN is a layer in the internet ecosystem, consisting of high-performance edge nodes distributed around the world. These nodes store your content according to the caching rules. When a user requests content, the request will be routed to the edge node closest to the user to speed up access and improve availability.
CDN involves caching and origin-pull. When a user accesses a URL, if the requested content is not cached on the edge node, or the cached content has expired, the content will be pulled from the origin.
An access node is a domain name assigned to a bucket according to the bucket's region and name during bucket creation. You can access data stored in the bucket at this domain name.
If the static website feature is enabled, you will be provided a static website access node, which can present specially configured responses that are different from that of the default access node.
You can accelerate access to COS by managing the following two domain names:
Note:The default and custom CDN acceleration domain names are collectively referred to as CDN acceleration domain names.
If a COS bucket is set to public-read and COS is used as the origin for CDN origin-pull, you don't need to enable origin-pull authentication, and CDN edge nodes can get and cache objects stored in the bucket.
You can still protect your objects in the bucket to some extent by enabling authentication configuration in the CDN console. No matter whether this feature is enabled, users who know the bucket access domain name can access all objects in the bucket. Whether users can access the public-read bucket in different CDN authentication configurations is as described below:
CDN Authentication | Access at CDN Acceleration Domain Name | Access at COS Domain Name | Use Case |
---|---|---|---|
Disabled (default) | Yes | Yes | Site-wide public access via CDN or origin |
Enabled | URL authentication required | Yes | Hotlink protection enabled for access via CDN but not origin (not recommended) |
If a bucket is set to private-read (default) and COS is used as the origin for CDN origin-pull, CDN edge nodes cannot get and cache any objects. Therefore, you need to add the CDN service identity to the bucket policy and authorize the identity to perform the following operations:
You can authorize the identity quickly in either the CDN console or the COS console by clicking Add CDN Service Authorization. Then, enable Origin-pull Authentication. In this way, CDN edge nodes can use the service identity to access COS objects.
Note:
- If the bucket is set to private-read, you must add the service authorization and enable origin-pull authentication; otherwise, access to COS will be denied.
- A CDN edge node will generate a service account for each root account. Therefore, the account authorization is only valid for the root account to which the acceleration domain name belongs. If the acceleration domain name is bound to another account, access will be denied.
After you added the CDN service authorization and enabled origin-pull authentication, CDN edge nodes can get and cache data. Therefore, we recommend you enable authentication configuration if you need to protect private data stored in the bucket. Whether users can access the private-read bucket in different CDN authentication configurations is as describes below:
CDN Authentication | Access at CDN Acceleration Domain Name | Access at COS Domain Name | Use Case |
---|---|---|---|
Disabled (default) | Yes | COS authentication required | Direct access to the CDN domain name to protect the content on the origin |
Enabled | URL authentication required | COS authentication required | Full-linkage protection (with hotlink protection for CDN authentication supported) |
Apakah halaman ini membantu?