Accelerating Workers & Pages Projects with Preferred Domains
Accelerating Workers & Pages Projects with Preferred Domains
Section titled “Accelerating Workers & Pages Projects with Preferred Domains”While there are many tutorials online about setting up preferred domains for websites using Cloudflare CDN, there are few specifically addressing Workers and Pages projects. This leaves many beginners only able to use Cloudflare’s assigned IPs for CDN acceleration. This tutorial will teach you how to set up preferred domains for Workers and Pages projects to make your projects run faster.
Prerequisites
Section titled “Prerequisites”First, you need to determine which preferred domain you will use. You can use your own preferred domain or one maintained by the community.
- The preferred domain used in this tutorial is
visa.cn
- You need a domain that has been transferred to Cloudflare (free domains with two-way resolution cannot be used), example:
0163.eu.org
Using Preferred Domains for Workers Projects
Section titled “Using Preferred Domains for Workers Projects”The custom domain example used in this tutorial for the Worker is todo.0163.eu.org
.
-
Add CNAME Resolution Record
Add a CNAME-type resolution record for your domain
todo.0163.eu.org
:- Name: Enter your desired custom domain, such as
todo
; - Target: Enter your preferred domain, such as
visa.cn
;
- Name: Enter your desired custom domain, such as
-
Add Route for Workers Project
Go to Workers Routes in the left menu bar, click Add Route:
- Route: Enter your final custom domain in this format:
todo.0163.eu.org/*
- Worker: Select the corresponding project name, click Save.
- Route: Enter your final custom domain in this format:
Before and After Comparison for Workers Project
Section titled “Before and After Comparison for Workers Project”

Using Preferred Domains for Pages Projects
Section titled “Using Preferred Domains for Pages Projects”The custom domain example used in this tutorial for Pages is drive.0163.eu.org
.
-
Add Custom Domain to Pages Project First, add a custom domain to your Pages project, note down the CNAME target domain
drive-ba3.pages.dev
, and wait for the custom domain to take effect. -
Use Huawei Cloud International - DNS Service
The international version doesn’t require real-name verification. If you’re frequently redirected to the domestic version during registration, please enable global proxy mode to register.
Set security phone (can be skipped)
Activate Huawei Cloud
Being redirected to the “Complete Information” page means registration is complete, you can ignore the binding prompts.
-
Add Custom Domain to DNS Service
Click to go to DNS Service, then click
Public Domain
Click
Create Public Domain
in the top right cornerEnter the Pages custom domain
drive.0163.eu.org
that needs optimization, then clickOK
Click
Manage Resolution
fordrive.0163.eu.org
After entering
Manage Resolution
, clickAdd Record Set
in the top left cornerAdd a new
CNAME Record
- Record Type:
CNAME - Point domain to another domain
- Host Record: Leave empty
- Line Type:
Default
- Record Value: Pages project assigned domain
drive-ba3.pages.dev
Add another
CNAME Record
- Record Type:
CNAME - Point domain to another domain
- Host Record: Leave empty
- Line Type:
Geographic Resolution
>Mainland China
- Record Value: Preferred domain
visa.cn
Hover over the first
NS record
and copy all four NS record values to save.ns1.huaweicloud-dns.com.ns1.huaweicloud-dns.cn.ns1.huaweicloud-dns.net.ns1.huaweicloud-dns.org. - Record Type:
-
Set Custom Domain NS Records to Huawei Cloud NS Records
Add four
Huawei Cloud NS type
resolution records for your domaindrive.0163.eu.org
to take effect.
Before and After Comparison for Pages Project
Section titled “Before and After Comparison for Pages Project”
