Setup your Zesty.io content instance to load through your CDN.
This guide will cover setting up your content instance domain, your CDN to route to a Zesty.io origin, and testing cache purging. Note this is an enterprise feature and needs to be configured by the Zesty.io team for purging to work properly.
The WebEngine origin is a special domain that routes Zesty.io WebEngine which renders published content, code, and API endpoints. You provide this domain to your CDN configuration.
Once your domain is setup in step 1, you will use that domain to find your custom origin url. For example, if you setup mydomain.com, your origin would be mydomain-com.webengine.origin.zesty.zone
3.) Configuring your CDN
Use your mydomain-com.webengine.origin.zesty.zoneequivalent as the origin or host in your property settings. You may access this origin in https or http. Be sure to use the correct protocol based on if you are serving TLS.
Cache Headers: Configure the CDN property rule to respect cache headers for the specific Zesty.io origin. If you are setting it to a specific path (subdirectory like /blog/) and have multiple rules on a property, ensure that only that specific rule. If you are setting up Zesty.io on a sub-directory be sure to test that you are not chancing caching for your other sud-directory properties before deploying.
HTTPS Setup: When requesting HTTPS, you need to reference the public CA (certificate authority) bundle into your configuration. Some services like Akamai will have a button to pull the origin CA automatically. For other services, you make need to request
HTTPS Redirect: For HTTPS redirect, set a rule in your property configuration for 301 redirect with query parameters to the https version. (for example http://mydomain.com/?utm_campaign=12345 redirects to https://mydomain.com/?utm_campaign=12345)
WWW Redirect: If you are servicing an apex domain like https://mydomain.com as http://www.mydomain.com, you will need to set a rule to 301 redirect with the query string (for example https://mydomain.com/?utm_campaign=12345) to the www version of the domain or the non-www version, whatever your preference is. Whatever version of the domain you chose, you can set the www behavior in manager ui > settings > general. This will ensure your canonical tags match your desired domain.
Hybrid CDN data flow visualization
4.) Configure Purging
For Zesty.io to custom purge your CDN service, you will need to provide the Zesty.io EcoSystem which your content instance is associated with a purge url. That purge URL need to accept a POST request with a JSON raw body payload that looks like:
A simple payload is an array of strings, which are often ZUIDs in Zesty.io. Page resources that WebEngine renders are tagged with ZUIDs in header tags for CDNs to located them directly.
To secure this endpoint from being called, you may optional setup a secret key, which zesty will post as the header X-Auth that value can be saved to Zesty.io along with your purge url endpoint.
--header 'X-Auth: xxxxx'
Zesty.io automatically adds ZUIDs to headers that are recognized by Akamai. Akamai refers to them as edge-cache-tags. Learn more about Edge Cache Tags from Akamai's documentation.
Setup API tokens with administrator access. This will be needed to run a purge