There are many different ways to implement the StackPath CDN with your website. If you developed a custom website, then we can help you integrate it with our StackPath services.
This tutorial assumes a Site has been created and the CDN is enabled in your StackPath Portal. If not, here is a walkthrough to creating a StackPath Site.
It's important to understand the difference between an origin URL and Edge Address before moving further in this tutorial.
An origin URL is a URL such as http://yourdomain.com that points to the main server. An Edge Address is a URL automatically generated after a Site is created. This looks like http://site.company.stackpathdns.com. If a custom Edge Address is created using a CNAME record, the Edge Address looks like http://cdn.yourdomain.com.
Configuration
If implementing the StackPath CDN with a custom-built site, go into the source code of the site and point static content to its corresponding CDN location. To do this, replace the origin URL with the Edge Address.
The location of files on the CDN will mirror the location of static content on the origin server, so you do not have to edit the path. For instance, if there is a file on the origin located at yourdomain.com/images/logos/big.jpg, its location on our CDN would be http://something.stackpathcdn.com/images/logos/big.jpg.
Changing the URLs in your source code will look something like this:
Replace
<img src="ORIGIN_URL/images/logos/big.jpg" alt="" />
OR
<img src="/images/logos/big.jpg" alt="" />
With
<img src="EDGE_ADDRESS"/images/logos/big.jpg" alt="" />
All you're doing is swapping the origin URL for the Edge Address.
Do not alter the URLs of pages and dynamic content, as dynamic content will not cache correctly.