Categories
WordPress

How to Setup MaxCDN with WP Super Cache Plugin?

If you are using WordPress, then you can instantly start using MaxCDN with it using WP Super Cache plugin. Let’s check out in this post, How to configure the CDN service with the plugin?



Primary Step: Create Pull Zone in MaxCDN and CNAME in Web Hosting Control Panel

1. Login to your MaxCDN Account using this link.

2. Once you are logged in, we need to create a Pull Zone. Go to Manage Zones and Click on Create Pull Zone Button:

create pull zone maxcdn

3. On the immediate next page, you are required to fill out following information:

new pull zone maxcdn

  • Enter anything, say your Nick Name, in the Pull Zone Name field.
  • Enter your Blog URL (including http:// and www) in the Origin Server URL field. If your blog URL don’t have www in it, then there’s no need to enter it.
  • Enter the address (in format of your website’s sub-domain) which you want to use with your Blog for serving content from CDN in the Custom CDN Domain field. E.g. cdn.abcd.com, files.xyz.net etc. – No need to enter http:// and www here.
  • Enter any keyword(s) relevant to your Blog in the Labels field OR leave it blank
  • Enable Gzip Compression by checking the box in front of Compression. The compression will be valid for Text, HTML, JS, CSS and XML files.

4. Once you have entered all the above details precisely, click on Create Button and your Pull Zone will be ready. You will also get your Temporary CDN URL on the next page, which will look something like following address:

abc.xyz.netdna-cdn.com

* Here abc and xyz will depend on your MaxCDN Account information and the details you entered while creating a Pull Zone.

Using this temporary CDN URL, you need to configure CNAME Record in cPanel, Plesk etc., so that your Custom CDN Domain (cdn.abcd.com, files.xyz.net etc.) can start working.

5. Log in to your Web Hosting Control Panel (cPanel in my case) and click on Simple DNS Zone Editor under Domains:

simple dns zone editor

On the next page, select your Domain Name from the Drop Down Menu for which you want to setup CDN service and you will see Add a CNAME Record here:

add a cname record

Note: The drop down menu will only be displayed, if multiple domains are present in your account. Else, you will only see your primary domain, that you entered while signing up with your hosting provider.

In the Name field Enter the Custom CDN Domain which you want to use with your Blog and in the CNAME field, enter the Temporary CDN URL which you obtained from MaxCDN.

Note:

1. No need to enter http:// and www here.

2. If you want to use cdn.abcd.com, then only enter cdn in the name field and “.abcd.com.” will be automatically added.

Once you have entered above information correctly, click on Add CNAME Record Button and the Record for your Domain Name will be instantly created.

Setting up MaxCDN with WP Super Cache

1. Install the plugin for your self hosted blog and then head over to CDN Tab in it. Here check the box is front of Enable CDN Support and enter the Off-site URL, which will be your Custom CDN Domain with http://:

wp super cache cdn settings

When entering Off Site URL, there’s NO need to add www with it. Also, there is no need to configure anything else on this page. Click on Save Changes button and your site will start serving CSS, JS, Images etc. from MaxCDN servers in a matter of few minutes.

Note: Just after enabling CDN, if you only see blank pages or broken site (missing CSS), then have patience!, as the data from your Hosting Server is being sent and stored on MaxCDN Servers worldwide. It may take up to 1 hour before you start seeing your site working normally again!

Additional Tips

Once you have successfully created a Pull Zone, click on Manage Button in front of your CDN URL and you will be able to configure following things on next page:

maxcdn manage pull zone

Origin IP

The Origin IP Address is the IP Address of the server on which your WordPress Blog is hosted.

maxcdn origin ip address

This IP Address is automatically fetched by MaxCDN Server, when you first create a Pull Zone. But if you want to change your IP address, then you can update and test the New IP Address here. While testing, if the validation process is successful, then you will see following message:

maxcdn ip address validation

Also, it’s recommended to enable Origin IP Resolution on this page:

origin ip resolution

Custom Domains

On the Settings tab, you can always set more than one Custom CDN Domain. This option is helpful when you want to serve different content of your blog using different sub-domains.

maxcdn custom domain

For example, you can serve CSS file of your site using abc.xyz.com and serve images using pqr.xyz.com. If you opt for this option, then you need to configure CNAME for each sub-domain separately.

Compression Settings

MaxCDN also allows you to compress your hosted content using Gzip compression technique. By enabling this feature, you will not only save your valuable CDN Bandwidth, but it will also speed up your WordPress blog. Following are the file types which the CDN server can compress:

  • text/plain
  • text/HTML
  • text/javascript
  • text/css
  • text/xml
  • application/javascript
  • application/x-javascript
  • application/xml
  • text/x-component
  • application/json
  • application/xhtml+xml
  • application/rss+xml
  • application/atom+xml
  • app/vnd.ms-fontobject
  • image/svg+xml
  • application/x-font-ttf
  • font/opentype

Delete Pull Zone

On the settings tab, you can also delete an entire Pull Zone. But be very cautious when doing so, as all your data from CDN Servers will be completely deleted.

This option can only be considered useful, when you want to create a NEW Pull Zone for your domain or terminate your MaxCDN Account.

Manage Cache

These settings allows you to Purge (clear and re-build OR re-request OR re-sync) file(s) from edge servers. This option comes very handy, when there’s a problem in loading certain file types in a browser or you have done a major update in your blog (like changes in Theme, Scripts, CSS etc.):

maxcdn cache

If anytime you think that your CDN Server is serving outdated content, then try purging all files.

Cache Settings

You can set following under cache settings:

cache settings

  • Override Cache-Control Header: It completely ignores Cache Control Header from the origin server and allows you to set maximum age of every request to 1 day, 7 days, 1 Month or 12 Months. The default value is in every account is No Override.
  • Default Cache Time: Any request without a Cache Control header from the origin stays on the server for 1 day, 7 days, 1 Month or 12 Months. By default, it is set as 1 day for every account

HTTP Referrer Protection / White list

This feature allows you to block direct access to your CDN files by some other domain name. It’s a feature just like Hot link protection for images.

http referrer whitelist

You are required to enter a list of all domains and sub-domains which are allowed to have direct access to your files. All other domains outside this list will get a 403 Forbidden error.

Edge Settings

edge settings

You can enable or disable following under Edge Settings:

  • Query String: This option, when enabled, treats every Query Strings as a different cacheable item.
  • Content Disposition or Forced File Download: This option, when enabled, forces each and every file to get downloaded on your visitor’s computer, instead of opening them in browser.
  • Strip All Cookies: Cookies, by default, are un-cacheable items and any file containing a cookie set in HTTP header (meant for authentication, maintaining session id etc.) also becomes un-cacheable. When this option is enabled, the CDN server ignores all cookies while requesting files from the origin and cache them.
  • Pseudo Streaming: Allows you to stream media content from standard HTTP servers like Tomcat, Apache, IIS and lighthttpd. Also, it enables “Seeking” for audio and video files.
  • Use Stale: Your files will never expire or gets deleted from CDN servers, when you enable this option. This option can be considered highly useful for static websites, whose content rare;y changes.
  • Ignore Cache Control: When you enable this, the CDN server will ignore any TTL (Time to Live) or Expiry Header set by the origin server.

EdgeSSL

If you want to use HTTPS or SSL for serving secure content from MaxCDN servers to your visitor’s browser, then you need to enable this feature.

Keep in mind, your Temporary CDN URL will change from abc.xyz.netdna-cdn.com to abc.xyz.netdna-ssl.com and you need to configure CNAME accordingly.

edgessl

For this feature to work, you must have a Shared or a Custom SSL Certificate and it must be present in your MaxCDN account.

Custom Robots.txt under SEO

It’s suggested to keep this option Disabled. Create a robots.txt file yourself, by using a Text Editor, and upload it to the root directory of your domain name.