How to setup StackPath Full Site CDN Integration – Guide

If you have a WordPress website and want to use StackPath Full Site CDN caching follow this guide to achieve this. You will have all your WordPress website files served by StackPath CDN and not only static assets.

WordPress web administrators have two integration options with StackPath: Static Assets Integration or Full Site Integration. The best integration method for you depends on your specific needs. We will try to explain how each choice functions in order to assist you in making the right decision.

Full Site Integration (recommended method from StackPath)

A Full Site integration delivers all content for your site through the StackPath CDN and is required to utilize the StackPath WAF (Firewall). You also need to make DNS changes during the integration process.

DynamicStaticStaticStaticStaticStatic
HTML rendered from…Common filesImagesFontsVideoAudio
PHP.js.jpg.ttfmp4.wav
NodeJS.css.jpeg.eot.m4a.mp3
C++.webp.gif.woff.m4v.wma
Perl.zip.ico.woff2.mov.ogg
Ruby.txt.png.otf.ts
Python.m3u8.bmp.svg
.svgz

How StackPath Full Site Integration works

StackPath offers Full Website Integration through its CDN and you can pass an entire website through their services. With this method you get the most out of its oprimised network. To route all requests through StackPath you must make a DNS change.

All requests will be routed via StackPath’s PoPs after you create a DNS record, as discussed below. Both static and dynamic assets can be cached and delivered from the CDN using this process.

You obviously need a StackPath account to follow the steps in this Guide, so if you don’t already have an account, click here to register for a Stackpath account. (Affiliate link – We might earn a commission if you make a purchase on that website, at no additional cost for you).

Before CDN Integration: 

All files are delivered from a single domain. For example “www.domain.com” is pointed directly at the site’s Origin web server. For every instance the webpage is loaded, dozens of requests must be served. When traffic picks up, the site will have progressively longer response times and is likely to return errors to some users.

After CDN Integration:

Once the DNS changes are propagated, “www.domain.com” is delivered through the StackPath network. (For full propagation you need to usually wait about 24 hours) Instead of all of these assets coming from your origin server, they are coming from one of StackPath Edge locations, served from many different IP addresses.

How to Create a new Site in StackPath Dashboard

Login to your StackPath account and add your website, by going to Sites, Create New Site.

StackPath add a new website

On the next screen click Select on the entire website option and click next.

StackPath add a new website

On the next page enter your domain name (must be www.example.com or subdomain.example.com, no http:// or https://).

Tip: A good and easy practice is to have the www.domain.com to point at StackPath CDN and setup our origin as the domain.com . That makes all requests at www.domain.com to be served from Stackpath CDN and the origin of the website (for StackPath to fetch your entire website and deliver it to users) will be the domain name without the www (aka domain.com). Just make sure your WordPress website url is https://www.domain.com .

StackPath add a new website

Then click Next.

StackPath add a new website

On the next page choose a name for your website (for StackPath and your reference only), choose a Custom Host Header (use www.domain.com), select your origin protocol (you better already use HTTPS), the Web Server IP Address or a Domain Name ( prefer using your shared ip from your Host) . Below you will find instructions how to find your shared ip address but in most cases StackPath autocompletes that. Leave WAF off for now and hit Create Site.

*Tip: For Cpanel you can find your shared ip (aka the ip of the server that hosts your website) by going to Cpanel and you will find it on the right side under General Information Tab.

Cpanel General information Shared ip address

Now you have created your website to StackPath and you need to make the needed DNS record change in your host. To complete your setup you need to CNAME www.domain.com to the Origin Url (StackPath CDN Url) provided by StackPath (something similar to site.company.stackpathdns.com).

Keep on reading to find some easy to follow instructions how to do this. If your website uses HTTPS protocol you also need to setup the SSL in StackPath in order to have your website secured. The ssl installed in your servre is not enough, you also need to install it in StackPath, and upload it every time you renew it.

Upload an SSL certificate that covers your domain and any subdomains when using HTTPS. If not done before DNS changes, your site will display an untrusted certificate.

StackPath configure SSL

How to Configure SSL in StackPath CDN

If you follow the above steps, click on Configure SSL, otherwise go to Sites, select your website and click Manage. On the left menu Select CDN and then SSL.

StackPath configure SSL

Click on Upload a new certificate to your account and give a name (include the date the ssl expires for your convenience) and copy the SSL certifcate, the SSL key and the Certificate Authority bundle. If you have Cpanel you can easily find (or install a free SSL certificate with Lets Encypt or AutoSSL.

How to install SSL certificate to StackPath CDN.

Now you have uploaded your SSL to stackpath too. You can proceed with setting up Full Page caching Integration from StackPath CDN.

The next step is to create a CNAME record in your host.

WordPress Full Site Integration through StackPath CDN

In order to use this integration, your website’s URL must resolve to StackPath’s Anycast IP address. You can do this in one of two ways: with StackPath DNS or your provider. For this Guide we will build a DNS record in our provider (we will use CPanel but your hosting provider will have a similar way around this). What you actually need is a CNAME pointing from your subdomain (www.domain.com) to your Edge Address.

How to make a CNAME pointing from your subdomain (www) to your Edge Address CDN Url (using CPanel)

Login to CPanel and go to Domains, Zone Editor. Some hosts might display it as  Simple DNS Zone Editor and/or Advanced DNS Zone Editor.

Cpanel go to Zone Editor

Select the domain you want Full Page caching and click “Manage”.

To Add a CNAME Record box click ADD and In the Name field, enter the prefix/first part of your custom domain.

-OR-

To Edit a CNAME record (- in our case www.domain.com) click Edit and in the record paste StackPath CDN Url (from previous steps). Click Save Record.

Once you click Save, every request to your website (for example www.domain.com) will be redirected from your host to Stackpath CDN Url. StackPath will start fetching your entire website and deploy it across its servers worldwide. From now on, all your website files, including html files and not only static files will be served from StackPath CDN.

All website assets that were previously distributed through your Hosting server will now be delivered through the CDN. You can’t access the files that are cached on the CDN through a WordPress plugin, unlike with a Static Assets integration. The StackPath control panel is needed for file caching management. On WordPress, optimization plug-ins and server-side caching plugins can still be used.

How to Enable StackPath WAF

After your Full Site integration, you will have access to WAF without modifying any configuration. Simply turn WAF on in your StackPath Control Panel. Go to Sites ,select your website and click Manage. Then go to the left menu and click on WAF, Settings. On WAF Status select WAF is Enabled from the drop down list and click Update.

StackPath enable WAF Firewall

Why Use WAF

PHP generates the majority of WordPress HTML on the server. If these HTML pages are cached incorrectly, users will be unable to log in, upload posts, or even access the admin panel. As a result, we still advise using WAF in conjunction with a WordPress Full Site integration.

Before WAF is enabled

There are a couple settings that should be enabled for WAF and CDN to work correctly with your WordPress site.

  1. WAF > Policies > Set CMS Protection > Whitelist WordPress admin logged-in users to On
    Your requests could get blocked due to the content of the requests (e.g. scripts). This will whitelist the session of a logged in admin user, allowing all administrator to navigate normally.
  2. WAF > Policies > Set CMS Protection > Whitelist Origin’s IP to On
    Enable this policy to whitelist requests coming from the origin for plugin updates and general CMS updates
WordPress CMS Protection with WAF

After WAF is enabled

A simple way to check if WAF is working is to blacklist your IP in the StackPath control panel under Sites > Firewall. Try to then access your site; you should be blocked.

Alternatively, you can examine your network requests. Once WAF is enabled, you’ll see a new request on every webpage. The request will appear to originate from your Origin and include the directory /sbbi/. This is your WAF validation request, and its presence means every request is passed through StackPath WAF.

You have completed the steps and you should enjoy WordPRess Full Website Caching with StackPath CDN.

If your website is not WordPress you can check this this guide to setup Full Site CDN.

Optimization tips for Full Website Caching with StackPath CDN

Check out the following Settings for a better Optimization on your Full Page Caching StackPath CDN settings. We have thoroughly tested and recommend these settings for better performance. They should fit most website needs but check them out with caution depending on your needs.

Optimization tips for Full Website Caching with StackPath CDN
Optimization tips for Full Website Caching with StackPath CDN
Optimization tips for Full Website Caching with StackPath CDN

If you liked this post please share it so other people can find it. It means a lot for us!
Spread the knowledge. Spread Love!

Leave a Reply

Your email address will not be published. Required fields are marked *