WP Engine Support Garage

How does a CDN work?

Thank you for telling us this article wasn't helpful. So that we may improve and help others in the future, what content should have been included?

Your Comment or Question *

captcha

Please Enter The Characters Above *

A Content Delivery Network (CDN) is a service that makes your static content (images, CSS, Javascript) much faster.

It’s a collection of servers located all around the world. When a browser loads static content, the request is automatically routed to a server physically closest to the browser. This makes the content load much faster. Because there are many servers everywhere, it also makes your site impervious to bursts of traffic, because the burst is spread out over literally hundreds of servers.

WP Engine automatically puts all your static content on a CDN. We manage distributing the content, rewriting URLs in the HTML, giving you control over enabling or disable the CDN temporarily, and technical support.

In short, you just write your blog as usual and we transparently make your blog faster and more scalable.

What CDN provider do you use?

Clients that are on the personal plan don’t have access to our CDN unfortunately. We recommend they use a free one, like CloudFlare. For every other plan, we go through MaxCDN Enterprise (we have a really strong relationship with them).

Where are your CDN servers located?

Here is a link to the page that show their server locations

Why are my CDN URL’s different than my domain name?

Normally your URL paths would be

http://domain.com/wp-content/uploads/image.jpg

With a CDN enabled, it becomes:

http://<installname>.wpengine.netdna-cdn.com/wp-content/uploads/image.jpg

This can always be changed to a custom CDN URL such as cdn.domain.com if you wish. You just need to setup a CNAME for cdn.domain.com to point to <installname>.wpengine.netdna-cdn.com then contact support and let us know so that we can make the required updates on our end. If the CDN was activated in the user portal then your CDN URL will not include your <installname>. It will appear as a long, cryptic string of letters and numbers. Once the CDN is activated you can view the page source of your website to retrieve the correct CDN URL in order to create the CNAME record.

What content is served by the CDN?

We serve all the statics we can find, as well as things which appear like dynamic PHP content but are in fact things like CSS, JS, and images, such as thumbnailing systems, minification plugins, and similar. Also core statics are served from CDN. You can specify additional URLs to force on the CDN, please contact support with the file path to the directory or file and we will include it for you.

Content not being found and delivered by CDN

If the links are relative (or even absolute) in the HTML, everything in the /wp-content/ directory will be properly sent to the CDN.

But in these cases the CDN will not pick up the content:

1. url() inside a CSS file which uses a full URL (i.e. http://yourdomain.com/…) as opposed to a path only e.g. url(“/image.gif”) or url(“image.gif”). Paths in CSS need to NOT use domains because we don’t search/replace inside CSS. You can edit the CSS file to use the CDN domain, but again in that case just don’t use the domain at all so it works in other contexts like on a local laptop.

2. Javascript which calls back to the server or references stuff on the server, especially if AJAX is producing new HTML. We can’t “see into” the Javascript process, and we don’t post-process AJAX requests.

How do I enable the CDN for my site?

In order to enable the CDN first you need to log into the user portal. Select the WordPress install that you wish to enable CDN on. Click on the CDNs link on the left hand side. Then check the box for the domain that you wish to enable CDN for. The list for domains that CDN can be enabled on is generated from the list of domains found inside the domains link just above ‘CDNs’ link. There will not be any list if your account does not include CDN support. If you wish to have a custom domain name for your CDN please submit a support request including the CDN zone URL (found by viewing your page source after CDN is set up) and the custom URL for the CDN.

Note: The CDN can take up to 10 minutes to configure and everything to clear through the cache, if images aren’t displaying correctly at first it could be because of this.