Hybrid CDN Setup
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.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.
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-Auththat value can be saved to Zesty.io along with your purge url endpoint.
--header 'X-Auth: xxxxx'
Setup API tokens with administrator access. This will be needed to run a purge
Setup an API token with purge access. This will be needed to run a purge on your custom endpoint.
Hybrid is an enterprise offering from Zesty.io, please reach out to support for help or clarification.
When you have a purge function deployed and have tested that you can post a payload to it to trigger a cache purge, you will then want to update Zesty.io to know about the URL and the x-auth key. Rest API documentation can be found here https://accounts-api.zesty.org/?version=latest#d1864580-86f7-4ff4-afdd-edea5563992a
Once added, code and content updates will automatically run your purge request.
Note that clicking the Clear Cache buttons in the Manager UI will ultimately trigger a cache purge in your configured CDN
Update EcoSystem to run a remote Purge URL