Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Configuration Process

Updated on 2024-11-14 GMT+08:00

Background

A game website mainly serves users in the Chinese mainland. It has a large number of files such as software packages and pictures stored on OBS. As the number of users increased, game downloading and image loading became slower, especially for users who are far away from the file storage area. To address this issue, the website decided to use the CDN service to accelerate game downloads at the lowest cost and improve user experience.

Required Data

Item

Description

Example

Domain name

Domain name of the game website. If the service area of your website is Chinese mainland or global, the domain name must be licensed by the Ministry of Industry and Information Technology (MIIT) and the license has not expired, according to China's Internet Management Regulations. Otherwise, CDN cannot provide the acceleration service for the domain name.

  • For details about how to obtain a license for a domain name on Huawei Cloud, see ICP License Service.

download.game-apk1.com (licensed)

OBS bucket

The OBS bucket version is 3.0 or later, the bucket policy is public read, and static website hosting is not enabled.

obs-doc-test

Procedure

  1. Store static resources such as images and software packages of the website in the prepared OBS bucket. You can create a bucket and upload files using OBS Console, OBS Browser, or SDK. For details, see OBS documentation.
  2. Add a domain name on CDN.
    1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

      The CDN console is displayed.

    2. In the navigation pane, choose Domains.
    3. On the Domains page, click Add Domain Names.
    4. Configure the domain name and CDN acceleration information.
      • Service Area: Select Chinese mainland.
      • Domain Names: Enter download.game-apk1.com. If you add this domain name to CDN for the first time, verify its ownership.
      • Service Type: Select File download.
      • Origin Server Settings
        • Origin Protocol: Select Same as user.
        • Type: Select OBS bucket.
        • Address: Select the obs-doc-test bucket.
        • Static website hosting: Do not select this option.
        • Bucket: Select Public bucket.
        • Priority: Select Primary origin server.
        • Host Header: By default, the bucket domain name is used.
        NOTE:
        • If you use an OBS bucket created after January 1, 2022 as the origin server and want to enable online preview, log in to the CDN console, choose Domains in the navigation pane, click the target domain name, click the Advanced Settings tab, click Edit next to HTTP Headers, and set Content-Disposition to inline. For details, see How Do I Preview Objects in OBS in a Browser Online?
        • If back-to-source by mirroring is enabled for your OBS bucket, do not select Static website hosting when adding an acceleration domain name. Otherwise, back to source does not take effect. For details, see Back to Source.
    5. Click OK.
  3. Configure a CNAME record on DNS.

    After the domain name is added, CDN automatically generates a CNAME for the domain name. The CNAME cannot be accessed directly. You must add it to your domain's DNS records. Then requests for your domain name will be redirected to CDN PoPs for acceleration. In this practice, the automatically generated CNAME is download.game-apk1.com.c.cdnhwc1.com. The CNAME configuration method varies depending on the DNS provider. In this document, DNS provided by Huawei Cloud is used as an example. For details about how to configure CNAME records on other DNS providers, see Configuring a CNAME Record.

    1. In the upper left corner of Huawei Cloud console, choose Service List > Networking > Domain Name Service.

      The DNS console is displayed.

    2. In the navigation pane, choose Public Zones.

      The public zone list is displayed.

    3. Click the domain name you want to add a record set to. In this practice, the domain name is game-apk1.com.
    4. Click game-apk1.com. On the displayed page, click Add Record Set in the upper right corner. The Add Record Set dialog box is displayed.
      Figure 1 Adding a record set
    5. Set the parameters as prompted. Use the default values for the parameters that are not listed in the following table.

      Parameter

      Description

      Example

      Name

      Domain name prefix.

      download

      Type

      Type of the record set.

      CNAME – Map one domain to another

      Line

      Resolution line. The DNS server will return the IP address of the specified line based on the source of visitors.

      You must add a Default line to ensure that the website is accessible to users of all carriers.

      Default

      TTL (s)

      Cache duration of the record set on a local DNS server. If your service address changes frequently, set TTL to a smaller value.

      5 min

      Value

      Domain name to be pointed to.

      If CDN acceleration is not enabled, the value is the bucket domain name. If CDN acceleration is enabled, the value is the CNAME generated by CDN.

      download.game-apk1.com.c.cdnhwc1.com

    6. Click OK.
  4. Check whether the CNAME record has taken effect.

    Open the Windows command line interface and run the following command:

    nslookup -qt=cname User-defined domain name bound to the bucket

    In this practice, the user-defined domain name bound to the bucket is download.game-apk1.com. If the CNAME generated by CDN is displayed, the CNAME configuration has taken effect.

  5. Configure the file download URL.

    Set the URL of the file to be downloaded in the code as follows: Domain name of the game website + Storage path of the file in the OBS bucket + File name.

    In the following example, the game website's domain name download.game-apk1.com and the android.apk file under the game/3.2.1/ folder in the obs-doc-test bucket are used. Then the file download URL is as follows:

    https://download.game-apk1.com/game/3.2.1/android.apk
  6. Verify the services.

    After the game website is redeployed, log in to the website, browse web pages, and download games.

    If images are displayed properly and the games are downloaded successfully, the acceleration configuration is successful.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback