Setting up Leaseweb CDN on WordPress

cdn graphSetting 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.

 

image1

When you click the “Add” button you’ll need to choose one of four “zones”. Since we’ll mainly serve static files (such as images, CSS and JavaScript files) from our WordPress website, choose the “Small files” zone for the best performance.

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:

 

image2

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.

You can proceed with either installing a plugin called WP Super Cache, W3 Total Cache or CDN linker.

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”:

image3

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”.

image4

The final step is to go to the frontend of your WordPress website and check the page source. You’ll see images, CSS and Javascript are loaded from the Leaseweb CDN.

image5

Congratulations! Now you’re in business.

 

 

Leave a Reply

LeaseWeb on Twitter

April 27th was King's Day in the Netherlands. It was a great opportunity to celebrate together with our customers

test Twitter Media - April 27th was King's Day in the Netherlands. It was a great opportunity to celebrate together with our customers https://t.co/WXZ73zehsB

Linux Engineer? Are you keen to work in a fast-moving environment with like-minded people? Let us know! We're hiring lnkd.in/gZ_7Ezd

test Twitter Media - Linux Engineer? Are you keen to work in a fast-moving environment with like-minded people? Let us know! We're hiring https://t.co/I4EHP3oSc2 https://t.co/pHuv5hxH1c

Read our CEO's reflections on the amazing growth that has made LeaseWeb the company it is today: blog.leaseweb.com/2017/04/26/loo… #LeaseWeb20

test Twitter Media - Read our CEO's reflections on the amazing growth that has made LeaseWeb the company it is today: https://t.co/vg5W5PUjRW #LeaseWeb20 https://t.co/jU0aayoqdk

"Mens sana in corpore sano" - Our team in training for last year's Viking Run #LeaseWeb20 #throwbackthursday

test Twitter Media - "Mens sana in corpore sano" - Our team in training for last year's Viking Run #LeaseWeb20 #throwbackthursday https://t.co/pCNEfXwmAa