Loading...

Knowledge Base

cWatch: Content Delivery Network

The cWatch Content Delivery Network (CDN) helps your website load faster and handle traffic more efficiently. It keeps copies of your website's content on servers closer to your visitors, reducing the time it takes for content to reach them. It can also help protect your website by filtering harmful traffic before it reaches your server.

 

On this page

 

How CDN works

Without a CDN, visitors get website content directly from the server where your website is hosted. The farther visitors are from this server, the longer it may take for the content to reach them.

With a CDN enabled, copies of your website's content are stored on CDN servers in different locations. When a visitor accesses your website, the CDN delivers the content from a nearby server when a cached copy is available. If the content isn't cached, the CDN gets it from your website's server, stores a copy when applicable, and delivers it to the visitor.

Enabling a CDN provides several benefits:

  • Faster load times: Visitors can receive cached website content from a server closer to their location.
  • Server protection: Reduces the amount of bandwidth and requests handled by your main web hosting server.
  • Built-in security: Incoming traffic passes through cWatch security filters before reaching your website.

 

How to activate cWatch CDN

Step1: Tell cWatch where to get your website content

First, you must configure your website’s IP address and origin settings in the cWatch settings to tell cWatch where to retrieve your website content.

  1. Access your cWatch.
  2. At the bottom left of your cWatch, click on Settings.
  3. Click on the Content Delivery Network tab.
  4. On the left menu, click Site Settings.
  5. On the Site Settings page, configure the following:
     
    • Origin IP: Enter your website’s IP address.

    • Custom Host Header: Select your website's domain name, such as <www.yourdomain.com>. This setting is especially important if multiple websites are hosted on the same server IP address (shared hosting). It ensures that the CDN retrieves the correct website content instead of the default website configured on that server.
    • Origin Protocol: Select whether your website is hosted over http or https. Choose the option that matches your website's current configuration.
    • Port: Specify the port used by your origin server.
       
  6. Click Save.

Make sure to enter the correct origin settings as this may affect the CDN in retrieving content from your website. Once done, proceed to DNS configuration. 

 

Step 2: Get your CDN DNS settings

  1. At the bottom left of your cWatch, click on Settings.
  2. Click on the Content Delivery Network tab.
  3. On the left menu, click on CDN Activation.
  4. Click the Check Propagation button.
  5. Select Add DNS records explicitly.
  6. Click Continue. You will see instructions on how to add the DNS records to point your domain to cWatch.
  7. Take note or copy the required DNS records for your cWatch CDN.

    The required DNS records look like below:
    Type Name Value

    CNAME

    www

    <UNIQUE-CNAME-VALUE>

    @

    A

    <UNIQUE-CWATCH-IP-ADDRESS>

 

Step 3: Update your DNS records

Connect your domain name to cWatch by updating your DNS records. The steps to add or edit the A records of your domain depend on the DNS zone you are using.

  • If you are using Crazy Domains DNS servers, follow these DNZ zone specific instructions:
  • If your DNS is hosted with another provider, follow these general setup instructions:
    1. Go to the DNS settings of your domain.
    2. Locate the existing A record for your root domain (domain without www) and update the IP address to cWatch IP address.
    3. Save the changes.
    4. Locate the existing CNAME record of your www domain. Updated it to the required cWatch CNAME record.
    5. Save the changes and wait for the new DNS records to resolve or propagate—up to 72 hours.

 

Other CDN settings

Once activated, you can check other CDN Settings for you to manage how content is delivered and cached across the CDN network.

 

Cache Settings

  • Use Stale: Enable this option to allow the CDN to serve expired cached content if the origin server becomes unavailable, especially during outages.
  • Query String: Enable this option to allow the CDN to control how pages containing query strings are cached. For example: https://yourdomain.com/page?id=123. The CDN can cache different query string values separately.
  • Ignore Cache Control: Enable this option to allow the CDN to override cache control settings configured on the origin server. When enabled, it disables the Use Stale setting above.
  • Set Default Cache Time: Click the dropdown and select how long you want your content to remain in the CDN cache before the CDN retrieves an updated version from the origin server.
  • Set Default Cache Time for File Types: Allows you to define different cache durations for specific file types, such as images, CSS files, JavaScript files, and other static assets.

    To set a cache time, follow these steps:
    1. Select the file type from the first drop-down.
    2. Set the cache time in the second drop-down.
    3. Click Add. Repeat to add more file types.

    Don’t forget to click Save after making your changes.

 

Edge Rules

  • Force HTTPS Connections: Enable this if you want to allow the CDN to automatically redirect HTTP traffic to HTTPS. Once enabled, all visitors are redirected to the secure version of your website. Before enabling this option, ensure your SSL certificate has been properly configured for CDN traffic.
  • Force WWW Connections: Enable this to force the www version of your domain. For example, requests for https://yourdomain.com will be redirected to www.yourdomain.com. This helps maintain a consistent URL format for visitors.

 

File Settings

  • Purge All Files: Click Purge to clear all cached files. After the cache is purged, the CDN retrieves fresh content from the origin server on the next request.
  • Purge Individual Files: Clears selected files from the CDN cache and forces the CDN to retrieve fresh content from the origin server upon the next request.

    To purge an individual file, follow these steps:
    1. Enter the file URI (the file path after your domain name), then click the + File Path to add it to the purge list.

      Example:
      https://yourdomain.com/images/logo.png
      URI: /images/logo.png
       
    2. Add additional file URIs as needed.
    3. Click Purge to submit the request and remove the specified files from the cache. 

 

Quick Configuration

Quick Configuration lets you tell cWatch about the content management system (CMS) you’re using to develop your website. This helps cWatch apply recommended CDN settings for your website.

While cWatch supports websites built on any CMS, the Quick Configuration feature currently provides preset configurations only for Joomla and WordPress.

To configure your CMS, select Joomla or WordPress from the dropdown and click Save.

 

 

Loading...