How to use Huawei CDN service

Yilmaz Caglar Gulgun
Huawei Developers
Published in
3 min readApr 28, 2023
CDN

Introduction

Hi ๐Ÿ‘‹๐Ÿ‘‹, In this article, I will show you how to use Huawei CDN. CDN is a technology used by many companies nowadays. We need to use CDN for fast performance and lower latency. In order to use CDN, we must first have a huawei cloud account.

Steps:

๐Ÿ’  After creating your account, you can access the CDN service from the huawei cloud console.

Huawei Console

You can see CDN main page ๐Ÿ‘

CDN Dashboard

๐Ÿ’  Now we need a domain name. Go to the Domains๐Ÿช„

CDN Domains Page

๐Ÿ’ Click Add Domain Name.

๐Ÿ’ Enter domain name

๐Ÿ’ Select Service Type โ†’ Website, File Download, On-demand Service, Whole site

๐Ÿ’ Select Service Area โ†’ Chinese mainland, Global(Chinese_mainland not included), Global

๐Ÿ’ Select Origin Server Address โ†’ IP address, Domain name, OBS Bucket

๐Ÿ’ Our example like that

๐Ÿ’ Service Type โ†’ Website Service Area โ†’ Global(Chinese_mainland not included) Origin Server Address โ†’ Domain name ๐Ÿ‘

Adding Domain Name

๐Ÿ’ We need to add the cname record on DNS

Domains Page

๐Ÿ’ Go to DNS service๐Ÿ‘‰

๐Ÿ’ Go to Public Zone and click Create Public Zone

DNS Page

๐Ÿ’ Enter Domain name

Creating Public Zone

๐Ÿ’ Go to the domain name

๐Ÿ’ Click Add Record Set

๐Ÿ’ Fill in the blank

๐Ÿ’ Name

๐Ÿ’ Type โ†’ CNAME Alias Line TTL Value โ†’ CNAME ๐Ÿ‘

Console

๐Ÿ’ Go back to CDN service

๐Ÿ’ Enter Domain name

๐Ÿ’ Change the origin server settings

๐Ÿ’ Change retrieval host to Origin server address

CDN Settings

Letโ€™s call the static files in your code from cdn.

src

Letโ€™s go to the domain name to check if your CDN works.

Product with CDN

Your request will now be answered by the nearest node and your data will be cached according to the cache rules you set on this node.

๐Ÿ‘Œ

Conclusion ๐Ÿ”š๐ŸŽ‰๐Ÿ’ข

In its simplest form, you now use CDN technology in your own product. For detailed CDN usage, donโ€™t forget to check our other articles.

We have completed all the processes, now you have a much faster website than before. You can get a quick response to the cached data via the node without going to the origin server. ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

References ๐Ÿ“œ๐Ÿ“š

--

--