There are two options for integrating StackPath's CDN. This article utilizes the recommended Full Site CDN delivery method, which is achieved through modifying DNS records. This method of integration will allow the StackPath CDN to cache all of the content on an origin, and accelerate the entire website.
This guide primarily focuses on the CDN Configuration, if you would like to configure a Site to use both CDN and WAF, please use the guide for CDN with WAF Integration.
About this Integration
The integration process will work with any subdomains for the primary domain but has been written with the common WWW subdomain in mind primarily. If a separate custom subdomain (blog or info) is desired, simply replace any instance of WWW with the custom subdomain.
This integration will involve adjusting DNS records for full site acceleration and protection, the StackPath DNS is recommended, but this is not a required service for this integration.
Add the Domain
Sites can be created with CDN enabled, as long as the Stack in question includes the StackPath CDN Service.
- Log into the StackPath Control Portal
- Navigate to the Sites page, and select Create Site
- Enter the domain name for the integration
- Select the CDN checkbox (along with any other services desired)
- Select Continue
- Confirm the Origin server data is correct and select Continue again
- This will generate the Site for the domain entered in Step 2 along with an Edge Address for the Site.
Configure Site Origin Settings
Before any DNS records are adjusted, it is best practice to confirm the proper configuration, to avoid any website downtime after the DNS records are adjusted.
To avoid any network errors while trying to reach the website through StackPath's systems, please confirm the following information within the Site settings for this domain before proceeding with the integration:
- Origin Address: This should contain the IP address of the origin server.
- Host Header: This field contains the value for the
hostrequest header StackPath will send to the origin server, this should be the primary version of the domain to be used.
If the website has a redirect in place to force WWW connections, the WWW subdomain should be used in this field.
- Origin Pull Protocol: This should match the HTTP version used by the website.
If redirection is enabled for HTTPS enabled on the origin, please set this option to HTTPS Only.
- Delivery Domains: The Apex domain and WWW subdomain should be added by default, but please add both if they are not present, along with any other subdomains intend to use with StackPath.
If the website uses HTTPS, please ensure an SSL certificate is uploaded or complete the validation process for the free EdgeSSL certificate, provided by StackPath. Free EdgeSSL validation will be completed automatically if DNS is already migrated to StackPath.
If HTTPS or WWW redirects are being utilized on the origin server these can be enabled within the EdgeRules tab under Sites > Website Domain > EdgeRules
Testing the Integration
Before completing the DNS Record Adjustment, please adjust your local Hosts file to force your domains to resolve to StackPath's services. This article provides instructions for integration verification.
Adjusting DNS Records - Go Live
With all of the preparation complete, the final step is to adjust DNS records to resolve the domain(s) to StackPath. This can be done via StackPath DNS (if the nameservers were already migrated); or via the current DNS provider, if not using StackPath DNS. This process will vary based on the DNS provider.
Adjust the record for the WWW subdomain to be a CNAME Record that resolves to the Edge Address provided. The WWW subdomain would look similar to this when using the StackPath DNS.
It is also recommended to point the apex domain to the anycast IP of the Edge Address in order to protect the real server IP from being discovered.
This step should be completed with an ANAME record or through Domain Shortening if offered by your DNS provider, as StackPath's anycast IP is subject to change at any time.
Test Speed and SEO Post Integration
Compare the before and after tests and note that it can take one to seven days for a website to reflect the performance improvements of a CDN. Both of these test sites also will give SEO recommendations.