Solution Overview

Background

More and more companies in different industries use OBS buckets to store static resource files such as images, videos, and software packages. They use the OBS buckets as the storage source for websites, forums, apps, and games. Users can directly request these static resources from OBS using URLs. OBS buckets can solve the problem of insufficient local storage. However, the response speeds for users accessing OBS buckets in other regions are different, since files are generally stored in only one region. In scenarios where frequent access is required, accessing OBS buckets to obtain files consumes a large amount of traffic.

Solution

HUAWEI CLOUD CDN can effectively accelerate websites to deliver a better user experience. OBS buckets can store massive numbers of files. Storing data in OBS buckets and using CDN for service acceleration can both reduce costs and improve user experience. When a user initiates an access request, CDN checks whether the content requested by the user is cached on the CDN node with the fastest response speed. If the CDN node has cached the content, the CDN node directly returns the content to the user. If the CDN node does not cache the content, the CDN node retrieves the content from the origin server, returns the content to the user, and caches the content.

Solution Advantages

  1. Low costs
    • If CDN acceleration is enabled for an OBS bucket, content in the OBS bucket will be cached on CDN nodes. CDN nodes do not need to retrieve the content from the bucket when users request the content. The cost of CDN acceleration is low. With CDN acceleration, you can reduce bandwidth costs by 50% to 57%. For details, see Cost Optimization with CDN.
    • OBS provides pull traffic packages with preferential prices for CDN to request content from OBS. For details, see OBS Billing for CDN Acceleration.

      OBS buckets for CDN acceleration cannot be accessed through the intranet.

  2. High efficiency
    • HUAWEI CLOUD CDN has abundant acceleration resources and widely distributed nodes. It ensures that user requests are precisely scheduled to the optimal edge node for effective and stable acceleration.

Scenarios

  • Applications or services that provide download services via HTTP/HTTPS through OBS, for example, websites that provide download services based on HTTP or HTTPS, download tools, game clients, app store.
  • Applications or services that provide audio on demand (AOD) or video on demand (VOD) services through OBS. On-demand services include online education, video sharing, music or video on demand, and other audiovisual content.
  • Websites or applications that provide image materials through OBS, for example, portal websites, e-commerce platforms, news apps, and user-generated content (UGC) applications.

Limitations and Constraints

  • This solution applies only to OBS buckets whose version is 3.0 or later. You can view the bucket version in the Basic Information area on OBS Console.
  • Only OBS buckets (public and private) in the Chinese mainland, Hong Kong SAR (China), Singapore, and Bangkok can be connected to CDN using the OBS bucket domain name. Public OBS buckets in other regions can be connected to CDN only using the origin domain. Private OBS buckets in other regions cannot be connected to CDN.

Accelerating Downloads of Files Encrypted by KMS

By default, CDN cannot read encrypted files in OBS buckets. If such files exist in your OBS bucket, enabling CDN acceleration may cause leakage of encrypted objects. If you need to accelerate downloads of files encrypted by KMS in your OBS bucket due to service requirements, pay attention to the following:
  • If your OBS bucket is a public bucket, CDN cannot read files encrypted by KMS in the bucket. As a result, the retrieval fails and users cannot access the encrypted files.

    Solution: Move the encrypted files from the bucket to a private bucket, and then configure CDN acceleration for the private bucket.

  • If your OBS bucket is a private bucket, assign the KMS Administrator permission to the CDNAccessPrivateOBS agency. In this way, CDN can read and accelerate downloads of files encrypted by KMS in the bucket. For details, see OBS Private Bucket Retrieval.