Setting up WordPress on LeaseWeb CDN is very easy, as you’ll see. A couple of assumptions before we start:
- WordPress is installed on the origin server
- WP Super Cache or similar is installed within WordPress
- An “Origin” that points to your WordPress installation is already defined within your LeaseWeb CDN control panel.
Configuring the zone itself
First thing you want to do is to configure a Pull Zone. Do this by going to “Manage Zones” -> “Pull Zones” and click the “Add” button.
Now configure your new zone. Start by filling in your CNAME and choose your “Origin” that’s already been created.
This will generate a “Target”. This is what we’re going to use for WordPress to serve static files on. You can also add the CNAME itself to your DNS, pointing to the target generated.
Under “Advanced settings” you can add additional CNAMES. This might be beneficial if you want to increase the concurrent connections your site may use to download static resources. In general between one and three domains is recommended but test it for your specific site because it might differ a bit. Next, go to “Edge settings” and activate “Ignore Cookies” as well as “Cache query string” as below:
Scroll down and click the “Save” button. Then wait 1-2 minutes for the zone to become fully active on the CDN.
Configure WordPress to make use of Leaseweb CDN
The next step is to actually tell WordPress to make use of the CDN to serve static files.
In this post we’ll use WP Super Cache as an example. You go into WP Super Cache, which can be found under “Settings” -> “WP Super Cache”. Set Caching to “On”:
After this you go to the “CDN”-section within WP Super Cache, and check the checkbox “Enable CDN Support” as well as putting the CDN url http://.lswcdn.net in the “Off-site URL” input field you see, and then scroll down and click “Save”.
Congratulations! Now you’re in business.