This guide assumes you have already created a site.
The StackPath Edge Address is the unique stackpathcdn.com URL provided when a site is created. This URL is used to identify a site on our servers and provide a gateway to connect to our network. This article will show you a variety of ways you can utilize our Edge Address.
After selecting the site you would like to modify from the Sites panel, the Edge Address will be visible in the top right corner of each tab related to that site's settings.
If you intend to use SSL (HTTPS) content pulls for your website, make sure you set the Pull Protocol setting to either 'HTTP or HTTPS' or 'HTTPS Only'
Static Assets Integration
Static Assets integration is one of two methods you can use to integrate your website with StackPath's CDN. This method does not require any changes to your DNS (unless you want to use a custom subdomain), and relies on URL rewrites for caching. Below are three different ways you can use Static Assets integration on your website.
Basic CMS Plugin Integration
Upon successful integration, these plugins will do the rest of the work for you automatically, by replacing file paths on your website with the StackPath Edge Address.
https://www.website.com/css.framework.css, will call for the use of
https://k9u6i7t4.stackpathcdn.com/css.framework.csswhen referencing the file instead.
A successful Static Assets integration will have the Edge Address appear in your website's source code, or in content requests, as seen here:
For more information on how to verify a website's CDN integration status, please visit our Verify and Troubleshoot a CDN Integration article.
Custom Website Integration
Although Full Site integration is the recommended integration method for custom websites not using a CMS, it's still quite possible to integrate statically instead if desired.
To apply Static Assets integration to a custom website, all you will need to do is replace the origin URL with the Edge Address in your site's source code.
For more details on this integration method, please refer to our Integrate a Custom Website with StackPath's CDN article.
CMS Plugin Integration using a Custom Subdomain
If you'd like to apply Static Assets integration to your website, but don't want to expose the Edge Address in website's source code, or content requests, then we also support the option of using a custom subdomain.
Integrating with this method requires that the site's DNS records be modified. Normally, this is done by creating a CNAME record for a subdomain that points towards the Edge Address.
If you would like to apply this integration method to your website, then please follow the steps below:
- Select a name for the custom subdomain you'd like to use in place of the Edge Address, then add it to the list of Delivery Domains located in the Settings tab in the portal.
- For this example, we have a website named spwaf.space and we are going to use cdn.spwaf.space as our custom domain.
- Upload an SSL certificate that covers your custom domain, or follow the steps to create a FreeSSL certificate. For more information on SSL certificates, refer to our Create and Manage SSL Certificates article.
- If you decide to use our FreeSSL, be sure to only check the custom subdomain when prompted to select the hostnames that will be included in the SSL certificate, as this is the only domain that we're integrating with StackPath's CDN.
- In your DNS, create a CNAME record for the custom subdomain that points to the Edge Address.
- Once you save the record, it's important to wait for it to propagate before using the custom subdomain in your CMS plugin or custom site integration. You can verify the record's propagation status using a tool such as whatsmydns.net.
- Your custom subdomain is now ready for use.
- If using a CDN rewrite CMS plugin (WP Rocket, W3 Total Cache, etc), then enter the custom subdomain when prompted to enter a CDN URL.
- If statically integrating a custom website that does not use a CMS, then replace the origin URL with the custom subdomain's URL.
Full Site Integration
In a Full site integration, all website content, regardless of whether it's static or dynamic, will be delivered to users from StackPath's network. This configuration requires that the website's DNS be pointed directly to the StackPath Edge Address and/or Anycast IP Address.
With this integration method, it's important to make sure that the Address field located in the site's Settings contain the site's origin IP address to ensure that the CDN pulls content from the correct location.
To prevent delivery issues, we do highly recommend configuring your site's settings in the portal prior to pointing the DNS records. Please review this article for more details on some of the other portal settings you can configure.
After you've finished with your settings, it will be time to update the DNS records. In our example below, we have a root domain named spwaf.space and a subdomain named www.spwaf.space. For root domains, we will point them towards our Anycast IP Address (22.214.171.124), and for subdomains (usually www), we will point them towards the Edge Address provided.
The root domain is indicated by @ in the example below, however, some DNS providers may not support the use of this character.
If you use HTTPS on your website, then this method will require you to either upload an SSL certificate that covers your root domain and subdomains, or follow the steps to create a FreeSSL certificate. For more information on SSL certificates, refer to our Create and Manage SSL Certificates article.