ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How to Use CloudFlare CDN in Your Website

Updated on March 23, 2018
Alessio Ganci profile image

Alessio is not one of Google Top Contributors in Google forums by chance: technology is one of his favorite topics! Check his articles here!

Content Distribution Networks

A CDN (Content Distribution Network) is a type of service which acts as an intermediate between the web server in which your website is hosted, and the final user who surfs your website. CDN servers are usually placed all around the world, and they provide caching features for static content of your website: this results in increased speed of your website, since all your static content is distributed by the CDN servers nearest to the user who is surfing your website. In addition, if your web server goes down for any reason, the CDN caching feature will be able to provide your users with a cached copy of your website, so that your users can still see static pages while your web server is down. In this article you will discover how to use CloudFlare, one of the most famous CDNs.

CloudFlare Logo
CloudFlare Logo

How to Use CloudFlare: a CDN and Much More

CloudFlare is just one of the most popular Content Delivery Networks, but it is not only a CDN. It offers various sets of services that will help you to get the most from your website, speed it up and also make it more secure. CloudFlare is free to use, however it also offers some paid plans (starting from around $10/month) which will offer you also more options. However the free plan just offers you a big amount of the CloudFlare features.

Where do you prefer to host your DNS records?

See results

Host Your DNS Records With CloudFlare

The first service offered by CloudFlare is DNS Hosting: to use CloudFlare services, you need to rely on their DNS server, but you can also enable the only DNS hosting without using any other service. By doing this you are using CloudFlare as your DNS provider without enabling other services, even if I strongly reccomend to try all the powerful features of CloudFlare! Hosting DNS on CloudFlare is a very good idea since, in case you want to transfer your domain to another registrar, you are able to just set nameservers without reuploading all your DNS records from a registrar to another one. Your records just stay in your CloudFlare account, while you need to set only the CloudFlare nameservers. In addition DNS service provided by CloudFlare is very fast!

A simple graph showing you how CloudFlare filters your traffic by putting itself in front of your DNS settings.
A simple graph showing you how CloudFlare filters your traffic by putting itself in front of your DNS settings. | Source

Filter Traffic by Using CloudFlare Firewall and Set Page Rules

CloudFlare also offers you a flexible firewall that will help you to set access rules to your website, filter IP addresses (so for example you can ban spammer IP addresses from accessing your website) and also set appropriate rules to prevent DDOS attacks. In addition, if CloudFlare detects a suspicious behaviour, it will prompt the user with a CAPTCHA verification code, or block his visits according to the rules you have set. You can also customize the prompt/block pages provided by CloudFlare, but only with a paid plan. If you upgrade to the business plan, you will also get advanced DDOS protection so that you can ensure your website will never go down after an attack.

You can also set forwarding rules and general page rules in order to match URLs to other URLs (in the free edition you can set a maximum of 3 forwarding rules). This feature is very useful if you need to set redirects from deleted content to updated versions of this content (and whose addresses are different, from example when you completely renew a website), or also if do you want to use a very simple tool to redirect "www" to the domain itself or vice versa.

Talking about page rules, you can set options in order to minimize JavaScript content and other static content, in order to increase loading speed of your website.

Source

Free SSL Encryption for Websites

You probably didn't believe that, but yes, with CloudFlare you automatically get HTTPS extension with a valid SSL certificate for free! However encryption is guaranteed only between CloudFlare servers and website visitors: if you want also to encrypt data transferred between your server and CloudFlare servers, you will need also to buy your own certificate as usual. However if you just want to provide basic encryption with the SSL icon and HTTPS protocol, you can get all of this for free by using CloudFlare!

Source

Analytics Service

CloudFlare also allows you to collect stats about traffic you receive on your website, so that you can just rely on this service, or you can also use Google Analytics in association. The stats include visits received to your website, details about these visits, and information about how much traffic have you saved by using CloudFlare service.

Protect Your Website and Supercharge It With Apps

CloudFlare finally protects your website by offering you some options like email obfuscation (so that spam bots cannot read email addresses, in addition they may be also filtered by firewall) and hotlink protection (so that other people cannot hotlink images and steal bandwith). In addition to that CloudFlare enables you to easily integrate some popular apps into your website in a click, and also subscribe to paid apps from within CloudFlare billing system. Example of apps are live chat widgets, Iubenda (an Italian startup that allows you to generate privacy policies for your websites), Google Analytics, security scanners and other various types of apps. Everything, without the need to write a single line of code or to implement scripts into your web pages, since you automatically implement services with a click through CloudFlare.

Test Your Knowledge

view quiz statistics

© 2015 Alessio Ganci

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://hubpages.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)