Hunk » Foreign trade station construction » How to use CDN to speed up your website – detailed use tutorial of Cloudflare free version

How to use CDN to speed up your website – detailed use tutorial of Cloudflare free version

Cloudflare is a well-known American CDN service provider and few of them can use it for free. Although its free version functions have shrunk compared with the paid version, it is still powerful. Today Hunk will introduce the detailed use tutorial of Cloudflare free version

Cloudflare has the following functions:

  1. Free and fast DNS service (effective in 1 minute)
  2. Free SSL certificate
  3. Restrict IP access and other operations in some regions
  4. Prevent network attacks
  5. Website caching and acceleration
  6. One cloudflare account binds multiple websites for free

Note: Cloudflare is a foreign service provider, so the setting of foreign trade websites is meaningful.

The following is the specific setting method

1. Register cloudflare account, add domain name and activate email

Enter the cloudflare official website, click sign up, enter the email and password, and then click create account.

 Cloudflare registered account 1

 Cloudflare registered account 2

Then it will jump to a page, where you need to enter your domain name. If you want to enter multiple domains at once, click I want to enter more domains at a time below

 Cloudflare Add Domain Name

Next, click NEXT, and then select the first free plan. Of course, if you have a budget, you can also select a paid plan. After selecting, click Confirm Plan, and then click Confirm

 Cloudflare selects free plan
 Cloudflare confirms to add a free account


Then click continue, and it will jump to a page where all the original DNS records of your domain name will be imported, so that the original website, mailbox and other services will not be affected after you switch to NS. But please note that you need to check whether the records imported here are all records, because occasionally Cloudflare will miss some. If you find some DNS records are not imported, you need to record them in whatsmydns.net to check all the original records, and then make up after the NS server switches to Cloudflare, otherwise some services will fail

In addition to importing the original DNS records, the following will also prompt you how many NS servers are on Cloudflare. I need to copy the two server values, and then go to the background of your domain name purchase to modify the NS server to these two values

 cloudflare 5
 Cloudflare prompts how to modify your NS server

You need to copy and record them in the document, and then go to your domain name management background to change the NS to these two. If you have multiple NS servers, delete the others, and only keep these two. Refer to the method for modifying NS Methods of modifying NS for Namesilo, godaddy and HiChina domain names

After the modification is successful, wait 1-2 hours for it to take effect.

Finally, you need to go to the mailbox you registered for CLOUDFIRE, click verify in the received cloudflare verification email, and complete the verification of the mailbox.

two Cloudflare overview menu settings

Wait a few hours, log in to the cloudflare account, and then click the domain name to be set to enter the setting menu.

First, let's look at the overview menu. This is a shortcut to all the main menus of Cloudflare, so we don't need to pay attention to most operations.

Only two shortcut operations can be opened when needed.

One is under attach mode , that is, when your website is attacked, you can open it to prevent attacks.

The other is development mode That is, when you want to see the result of the modification immediately when you modify the website, you can open it, so that the latest website page will be directly displayed instead of being cached.

If the above two settings are not needed, they will remain off.

 Cloudflare overview menu 1

In addition, you can see the traffic under the website, cache conditions, etc., and understand the basic situation of the website using cloudflare.

Other shortcut settings will be set on a separate page later.

 Cloudflare overview menu 2

3. Cloudflare Analytics menu settings

Here are some analysis data of the website after using Cloudflare, Analytics contains several submenus, Traffic, security, performance and DNS


Introduction to Traffic Menu

It mainly checks the website's requests, bandwidth, and visitors in a certain period of time in the past.

At the same time, the data of requests, bandwidth and visitor distribution of different countries will be displayed below for viewing.

 Traffic submenu of cloudflare analysis menu

Security Menu

This menu is mainly about safety information display

Threats

It displays data about threats received in a certain period of time, including the number of threats, countries from which they come, types of threats, etc.

Threats by Country

Data on threats from different countries

Rate limiting

This is a paid function. The free version doesn't work

Overview

List of safety related data

 Cloudflare analyzes menu security


Performance Menu

Origin performance(Argo)

This is a paid function. The free version doesn't work

Here is a preview of some performance data

 Performance menu of cloudflare analysis menu

DNS Menu

Mainly check some data queried by DNS

 DNS menu of Cloudlflare analysis

4. DNS menu settings of Cloudflare

In the DNS menu, you can add or delete all DNS records at will, or choose to use or not use cloudflare services.

 Cloudflare DNS menu setting 1

Here is a brief introduction to the method of adding DNS records in Cloudflare

1) First click A on the left, and then select different record type A, Cname, MX, TXT records, etc

2) Next, enter the name of the record you added in the Name box. If it is website resolution, it is usually filled in www or not. If it is email resolution, it is generally left blank,

3) Then enter the value of the record you want to add in the third box. For record A, fill in the IP address of the space you use, for cname record, fill in the domain name, and for MX record, fill in the record value provided by the enterprise mailbox, and fill in the corresponding priority.

4) After filling in the three items, click ADD record to add successfully.

 Cloudflare DNS menu setting 2

It is very simple to delete a record. Click the fork directly behind the record to delete it.

The website uses the service settings of CLOUDFIRE

Only record A or cname can be set to use CDN service

The method is also very simple. Just add the small cloud icon behind the A record, light it up, and it will switch to the state of using CDN.

If you don't want to use Cloudflare's CDN service, just click it again to turn it off and turn it gray, and then the CDN service will be turned off. Only Cloudflare's DNS is used.

Note: All the settings in this article will take effect only when this small cloud icon is turned on!

 Cloudflare DNS menu setting 4

The other three menus

Cloudflare Nameservers

What is displayed here is the nameservers you use in Cloudflare

Custom Nameservers

This is a paid version function. The free version is not available

DNSSEC & CNAME Flattening

Don't worry about it

 Cloudflare DNS menu setting 3

5. Crypto menu setting of Cloudflare

This is mainly about the setting of website encryption to strengthen website security

SSL

If your original website has an SSL certificate, select full here

Edge Certificates

The free cloudflare account does not need to be set here.

 Cloudflare encryption menu setting 1

Custom Hostnames

The paid version of cloudflare only has functions

Origin Certificates

If your original website does not have an ssl certificate installed, you can generate a certificate here and install it on the original space of your website. However, Hunk does not recommend this.

It is better to install SSL directly in the original space. Now many spaces can install ssl with one click, such as siteground, Very convenient.

Always use https

Always use the https link settings. Open it

Http strict transport security

Not required, can not be set

 Cloudflare encryption menu setting 2

Authenticated Origin Pulls & Opportunistic Encryption & Onion Routing

Open it

Minimum TLS Version

Select 1.1. If the selection is too high, the website may not open

 Cloudflare encryption menu setting 3

TLS 1.3 & Automatic HTTPS Rewrites

Open it

Disable Universal SSL

Keep this as the default

 Cloudflare encryption menu setting 4

6. Firewall menu settings of Cloudflare

In the Firewall menu, you can further set the website security and restrict the access of users from certain IP addresses or regions.


Events submenu

Here, you can view some small events of the firewall. For example, in the picture, some accesses are blocked after Hunk sets filter conditions

 Cloudflare firewall setting 1


Managed Rules submenu

Here are the paid cloudflare settings, and the free version can't be used

 Cloudflare firewall setting 2


Firewall Rules

Here you can set rules that restrict other people from accessing your website. Each account can only set 5 restrictions.

Here, you can set many desired shielding domestic IP access. First, click create a firewall rule

 Cloudflare firewall setting 3

In the open window

Rule name

In Field, you can select different filter objects. You can set the IP address or the country. Let's take the country as an example

Operator sets operations here, and you can select equal,

Value Fill in the countries you need to block here. Let's take China as an example

Edit expression

Choose an action

Finally, click deploy to add the rule.

This operation means that when Chinese users visit your website, they will be blocked directly.

 Cloudflare firewall settings 4

Then you can see it below.

If you don't need this RULE, click on "On" to turn it off

 Cloudflare firewall settings 5

TOOLS

The functions here are complementary to those of the firewall rules. They all make some necessary settings for users to visit your website

IP Access Rules

Mainly for IP, IP range, country and ASN setting rules

It should be noted that some functions can only be used in the paid version.

The operation method is also very simple. Take shielding IP as an example.

In the first box, enter an IP address, and then select a rule in the second box. In the third box, select the valid website or all websites on the cloudflare.

Add a note is to add a note, and then click Add. The settings are relatively simple.

 Cloudflare firewall settings 6

Rate Limiting & Zone lockdown

Paid function

User Agent Blocking

You can set the proxy used by the user, such as the browser type, CPU or operating system.

This operation doesn't work much, so I won't demonstrate it for the moment. If you have friends in need, you can study it. It's not difficult to operate.

 Cloudflare firewall settings 7

Settting

Here are some other settings

Security Level

This setting is low. If it is set too high, it will be too sensitive, causing many users to be affected

Challenge Passage

This is the validity period of the validation, which can be set a little longer

Browser Integrity Check and Privacy Pass Support

Both are set to ON, open mode.

 Cloudflare firewall settings 8


seven Speed menu setting of Cloudflare

Auto Minify

Web pages are minimized, and Javascript, Just tick the front of css html.

Polish / Railgum

Paid function

 Cloudflare speed menu setting 1

Brotli

This is a better web page compression method than gzip. Open it

Mirage

Paid function

Rocket Loader

This requires testing to decide whether to open it. There is no fixed answer.

You can open it and view the effect of the web page in different browsers. If there are problems with web page layout, close it.

Mobile Redirect

This can be set to jump to different links when you open your website on your mobile phone.

If you have a special mobile site, you can set it. If you don't have or need this setting, you don't need to set it.

The method is very simple. First select the target link you want to jump to, then select keep path, and then switch to On below.

If it is not needed later, just turn off the switch below.

Prefetching URLs From HTTP Headers

Paid function.

 Cloudflare speed menu setting 2


eight Caching menu settings of Cloudflare

Here are some settings for caching

Purge cache

This setting is to clear the cache

Custom purge can clear the cache of the specified page

This operation is also relatively simple. Click custom purge, enter the link to be cleared in the box, and then click purge.

Purge everything is to clear the cache of the entire website

Caching Level

Select standard here

Browser Cache Expiration

This is modified according to your own situation, and it is recommended that it be more than 7 days

 Cloudflare cache menu setting 1
 Cloudflare cache menu setting 2

Always Online

Just tick here

Development Mode

Because Cloudflare uses caching technology, when you update the content of the website, you may not be able to see the updated content in the foreground immediately.

At this time, you can see the updated content of the website as soon as you open the development mode. Of course, it is better to turn it off under normal circumstances.

Enable Query String Sort

The function of the paid version.

 Cloudflare cache menu setting 3


nine Page rules menu settings of Cloudflare

The free version can set the rule of three pages. If you want to buy more, you need to buy it.

There are many rules that can be set. One of the most useful ones is forwarding, which is 301 jump. There are many applications.

Here's a simple demonstration. For example, I want to jump to Baidu from my website wpshare.org

Click create page rules, and then enter the URL of the page you want to jump to in the first box. If you want to jump to the entire website, just add * after the full link.

If you only need to jump to a page, just fill in the URL of the page.

Then click Add settings below

Then expand pick a setting, and select 301 – permanent redirect in select a status code.

Enter the target link Baidu you want to jump to in the bottom box at the back.

Finally, click save and deploy to succeed.

After successful addition, the page rule will be listed below. If you do not cancel, just change the following on to Off

 Cloudflare Setting Page Rule 1
 Cloudflare Setting Page Rule 2
 Cloudflare Setting Page Rule 3
 Cloudflare Set Page Rule 4


ten Cloudflare Network Menu Settings

Leave all options as default.

 Network menu setting 1 of cloudflare
 Cloudflare network menu setting 2


eleven Apps+menu settings of Cloudflare

Under this menu, you can install some software on the website to enhance its functions. Here's an example.

First, search for the type you want to add in this box. Let's add a whatsapp chat tool to directly search for what

 Cloudflare apps menu setting 1

Then the whatsapp tool will appear in the following results, click it, and then click preview on your site

 Cloudflare apps menu setting 2

Then enter CALL TO ACTION and your whatsapp account on the left side, and select where whatsapp is displayed. Finally, click install on all pages to successfully install.

However, the free version can only be displayed on the home page, and other pages cannot be displayed. In addition, if you install other tools, the settings of each tool are different, and you need to set them according to the situation.

 Cloudflare apps menu setting 3


twelve Access, Custom Pages, Traffic, Steam and other menu settings

These are all paid versions that can be used. Don't worry about them.

Scan and share the circle of friends

 How to use CDN to speed up your website – detailed use tutorial of Cloudflare free version

Follow Hunk WeChat official account

Hunk has entered the foreign trade industry for 10 years, engaged in foreign trade business, and transformed technology for 12 years, engaged in foreign trade station building marketing. If you are going to build an independent foreign trade station, we have many professional technical articles for your reference. Hunk recommends Purchase domain name on namesilo , on siteground or cloudways Buy space on and use Google email. Of course, if you are not good at technology and have no time to study, you can find Hunk outsource to build a website or pay for solving problems

29 replies on "How to use CDN to speed up your website - detailed use tutorial of Cloudflare free version"

Hello Hunk,

Do you have a setup tutorial for Cloudflare Pro? Try to pay for one month. Many of the settings are incomprehensible and you dare not set them at will.

HUNK, Hello! Could CLOUDFIRE be used to block Chinese system language computers from accessing my website? How can I operate it if I can

Hello, after I open the proxy function of Cloudflare, that is, CDN, v2y cannot access the network. If you only use DNS services, v2 is OK. What's the problem?

You are driving a 1.5L naturally aspirated car, accelerating at 100 meters for 10S. Now add a turbocharger to your car, and the acceleration at 100 meters becomes 8.5S. Can you remove the 1.5L engine?

reply

This metaphor is very good. It makes people understand the relationship between these. I would like to ask the blogger, the siteground host I use, has its own CDN acceleration, so you don't need to use Cludflare's CDN acceleration?

After using cloudflare, The sender's IP addresses shown in the contact form 7 are all those of Cloudflare, and the original sender's IP address cannot be seen. How to solve this problem

Don't worry about SG. Don't use CF in the background of SG. It's not easy to use. Follow my tutorial directly. The root domain name and secondary domain name can be used

reply

How to understand the domain name resolution? My NS has already filled in the siteground. If it is replaced with cloudflare, it will not cause problems on the website

Hello, HUNK Excuse me: my website uses the server of linode, Nameservers is also the default of linode, but my website images occupy a large amount of memory, which greatly affects the website speed. In this case, can I use Cloudfare's free CDN acceleration to improve the website speed? thank you..

Hello, let me ask you a question. Is there any specific traffic limit or anything for the free cloudflare CDN acceleration?

Hello, HUNK,
I tried NS pointing to cloudflare. It's true that the network speed will be very fast, but I can't receive emails. I am Bluehost space. I'm not sure if it will conflict with the transit mailbox server.

The website of BLUEHOST space receives inquiries, which has not been solved for a long time. It is lucky to receive them, but it is normal not to receive them.

If possible, you'd better change to sg, which is much faster, and there will be no trouble of not receiving inquiry emails. Please refer to https://www.imhunk.com/2018-website-hosting-siteground-and-install-wp-ssl/

reply

I just raised the issue of cloudflare on the Liaoshen blog, but I didn't expect Hunk to act so quickly. Like one!

Post reply

Your email address will not be disclosed. Required items have been used * tagging

-->