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 can help the static content on your site (images, CSS, Javascript) load much more quickly.

A CDN is a collection of servers located all around the world. When a browser loads static content, the request is automatically routed to the server geographically closest to the browser. This helps the content load much more quickly. In addition, because your content is loaded from many servers in separate locations, bursts of traffic are less likely to cause issues, because the burst is spread out over hundreds of servers, rather than just one.

WP Engine offers the ability to put all of your static content on a CDN with little to no configuration required. We manage distributing the content and rewriting URLs in the code. We give you control over enabling or disable the CDN as needed. In short, you just write your blog as usual and we transparently make your blog faster and more scalable. CDN is included an no extra charge for our Professional plan and above. Personal plan clients can add CDN service for a small monthly fee.

What CDN provider do you use?
Our CDN services are provided via our partner MaxCDN. (Formerly called NetDNA).

Where are your CDN servers located?
MaxCDN’s network is comprised of servers located all over the world, including North America, Europe, and Asia. You can find more information about their data center locations on their pagehere.

Why are my CDN URL’s different than my domain name?
Normally your URL paths would be something similar to:

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

With a CDN enabled, they become:
http://<cdnzonename>.wpengine.netdna-cdn.com/wp-content/uploads/image.jpg

This is because those static assets are now loading from a third party server, rather than the same server where your WordPress site is hosted. If you’d like, the “cdnzonename.wpengine.netdna-cdn.com” part of the URL can be changed to a custom CDN URL such as cdn.domain..com. To do so, you’ll just need to setup a CNAME in your DNS Zone that points your custom subdomain to the default CDN URL, then contact support to let us know. We’ll then make the required updates on our end. If you’ve activated CDN from your user portal, you will see your default CDN URL there. Setting up a custom CDN URL is optional; you can leave your CDN URL as its default if you wish.

What content is served by the CDN?
By default, we serve all the static assets located in your wp-content folder from CDN. We also serve assets which appear like dynamic PHP content but are in fact static files like CSS, JS, and images. This includes thumbnailing systems, minification plugins, and similar. Core files are also served from CDN. If you have static assets you’d like served from the CDN that are stored outside the wp-content folder, please contact support with the path to the directory or file and we will include it for you.
< strong >Content not being found and delivered by CDN
Our script automatically rewrites your site’s assets to use the CDN URL once activated. Though there are some circumstances when our script will not catch the URL. These can include:

1. A direct URL inside a CSS file. This is a link that uses a full URL For example,http://yourdomain.com/… as opposed to a path only i.e. /image.gif” or “image.gif”. For our rewrite to work properly, paths in your CSS code need to be relative and not use full URLs, because we don’t search/replace inside CSS. You can edit the CSS code to use the CDN domain, but it’s best to structure your CSS code so all URLs are relative. This will help ensure compatibility overall, rather than just with CDN.

2. Javascript which calls back to the server or references assets 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?
To enable the CDN on your site, you’ll first log into the user portal. Select the WordPress install that you wish to enable, and click on the CDN link on the left hand side. Then check the box for the domain that you wish to enable. The list for domains on which CDN can be enabled is generated from the list of domains that have been attached to your install. This list is found inside the Domains link just above the ‘CDN’ link in your user portal. There will not be any domains listed if your account does not include CDN support. If you’re on a personal plan and adding CDN access separately, contact support by submitting a support ticket from within your user portal, and we’ll get CDN enabled for your install.

Note: The CDN can take up to 10 minutes to configure and everything to clear through the cache, so don’t be alarmed if you don’t see the change right away. If after 10 minutes you’re still seeing issues, just let us know.