Contact
Site: US UK AU |

How to configure CDN access for WordPress

How to configure CDN access for WordPress

What you need

Table of contents

  1. Log in to the CDN control panel
  2. Configure HTTP small customer origin
  3. Set up CNAME URL
  4. Configure WordPress
  5. Purge the CDN cache
  6. Activate CDN compression

1: Log in to the CDN control panel

  1. Log in to your Client Portal.
  2. From the dashboard, select Services > Other


  3. From the menu toggle, click CDN Control Panel.

     
From the control panel, you can configure the large and small HTTP platforms as shown in the next section. However, as WordPress mainly stores small static files, such as images and stylesheets, we recommend configuring HTTP small as shown below.

2: Configure HTTP small customer origin

  1. Select your preferred language.
  2. Click HTTP SMALL > Customer Origin.


  3. Enter your domain information in the corresponding fields.
    1. Directory Name: This is a new directory that you are creating on the CDN. It is the directory you will eventually use in your web addresses when you are serving content from the CDN. Do not use spaces or special characters. Please note that this directory does not correlate to a directory on your hosting service; it is just used for organizational purposes. If you use the “images” directory, you will still need to append another /images directory to the web address generated.
    2. HTTP Edge Protocol: Leave this check box selected. This puts your content on the CDN.
    3. Hostname or IP Address: Here, type the name or IP address of your host server. ote that the port will be automatically appended to the web address that you enter. This is the server from which the CDN will pull static content. Click Add to add the server to your list. You can specify additional locations if you have mirrored your content and would like failover.
    4. HTTPS Edge Protocol: Leave this field blank.
    5. HTTP Host Header: Leave this field blank.

  4. When finished specifying the settings, click Add.

3: Set up CNAME URL

  1. Select HTTP SMALL > HTTP Small Object


  2. From the URLs for your CDN Origin section, copy the portion of the URL that represents your CDN domain name. See below for an example.


  3. Select HTTP SMALL > Edge CNAMEs.


  4. In the New Edge Cname field, type the name of the desired CNAME record.


  5. In the Points To: drop-down menu, enter the origin server that shows the directory name you created in Section 2, Step 3 above. The below example uses "wordpress-directory."


  6. Log in to your SiteWorx account. 
  7. On the main menu, select Hosting Features > Domains > DNS Records.


  8. Locate the relevant domain, then click the corresponding View Records link. 


  9. From the Add a new drop-down list, select CNAME, then click Go. 


  10. In the Host field, type the hostname for the CNAME that you defined in Step 4 of this section. Ignore the TTL field. In the lias field, paste the web address you copied in Step 2 of this section.


  11. When finished, click Save. Continue to the next section.

4: Configure WordPress

Attention: This step requires a working installation of WordPress and the W3 Total Cache plug-in.

  1. Navigate to the settings page for the W3 Total Cache plug-in.
  2. Scroll down to the CDN section, and then click the Enable checkbox.


  3. For the CDN Type, select (Origin Pull) Generic Mirror.
  4. Click Save All Settings.
  5. On the WordPress side menu, under the Performance section, select CDN.


  6. Scroll down to the Configuration section.


  7. Under SSL support, select Disabled (always use HTTP), and then type your CDN CNAME in the Replace site's hostname with: field.
  8. Click Save all settings, to deploy your W3 Total Cache configuration. The CDN takes approximately one hour to cache the content. Also, any time the cache is flushed, it can take one hour to re-cache.
  9. Open your website to be certain there are no missing elements on your page. If there are missing elements, verify all of your settings are correct.

Once everything is working correctly, you can check the source code for the HTML page to ensure that your images, javascript, and stylesheets are being loaded from the CDN. You may also want to consider using a tool that tests the load time of a page, such as Pingdom Tools.

5: Purge the CDN cache

The simplest way to purge you CDN cache is through the Client Portal as shown below:

If, however, you wish to either purge the large cache or small cache individually, you may do so from the CDN Control Panel. From the Platform drop-down list, select either HTTP Large or HTTP Small, then click Purge Content.

6: Activate CDN compression

Activating compression on both HTTP large and HTTP small will help you get the most out of your CDN:

  1. Log in to your CDN Control Panel from the Client Portal as directed in section 1.
  2. Select HTTP Small > Cache Settings > Compression.
  3. Select the Compression Enabled radio button, then in the Files Types field enter:

    ,application/javascript

    Click Update when done.


  4.  Repeat Steps 2 - 3 for HTTP Large, but begin with HTTP Large > Cache Settings > Compression.

 For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to configure a WordPress multi-site network
Added on Thu, Mar 13, 2014
How to configure the Nexcess CDN with WordPress and W3 Total Cache
Added on Tue, Sep 10, 2013
What is W3 Total Cache?
Added on Fri, Oct 31, 2014
How to create Magento and WordPress dev sites
Added on Wed, Aug 3, 2016
How to configure WordPress file permissions
Added on Wed, Oct 29, 2014
How to add Favicons to WordPress
Added on Thu, Oct 31, 2013
How to combat WordPress comment spam
Added on Wed, Oct 29, 2014
How to configure WordPress plug-ins
Added on Tue, Jul 30, 2013
What is WordPress?
Added on Wed, Sep 11, 2013
How to change WordPress URLs
Added on Tue, Dec 10, 2013