The CDN integration feature allows you to serve the Dynamic Yield assets (and optionally, images that you upload through our system) from your own CDN as opposed to Dynamic Yield’s. This means that:
- Your site won’t have an additional external dependency.
- You can choose the CDN vendor, to both match your current contract with your CDN, and to make sure that there are servers as close to your visitors as possible.
- Your servers can optimize loading time, as they have full control.
Note: CDN integrations are not supported if you implemented Dynamic Yield via Salesforce.
Configuring CDN Settings:
- Go to Settings › General Settings. Under the Dynamic Yield script, click on the Enable CDN Integration link. Note: If script has been implemented, click on the script status or the code icon to reveal the link).
- Choose an upload method:
- passive-mode FTP
- SSH-based SFTP
- explicit-SSL passive-mode FTPS
3. Enter a Hostname, Username and Password used by the upload process.
4. Configure ‘Upload Directory’ (after the Username is FTP-authorized, the directory will be used for the upload).
5. Configure the public path.
6. Only select ‘CDN support HTTPS’ if your CDN actually permits it.
7. Save your configurations.
8. Test your configuration by clicking on the additional actions icon to reveal menu.
NOTE: Only upon receiving a successful test confirmation, the configuration will be activated. You may decide to pause or delete the CDN configuration at any time.
It is advised to perform the following steps:
- Configure the ‘Upload Directory’ to be set to ‘api/[section-id]/’.
- Create a directory on your server named ‘api/[section-id]/images’.
- Serving compressed JavaScript resources should be activated.
- 5 minute expiration for api_dynamic.js, api.js resources placed “Upload Direrctory” should be set.
- 24 hour expiration for api_static.js resources placed ‘Upload Dir’ should be set.
- Expiration for all resources placed ‘Upload Dir’/images/ should be set.
- Expiration to one year or longer is recommended.
- FTP/FTPS/SFTP should be open only to the following IPs:
- 52.0.20.215
- 52.0.81.217
To configuring usage of hosted CDN by Dynamic Yield-generated iframe:
After configuring all of the above and activating the hosted CDN, you will be able to serve API scripts for the CDN of your choice. API scripts will continue to be served and available on Akamai.
When serving iframes for Smarts, a URL to api_script.js is generated by Dynamic Yield. By default, we use our Akamai resources.
- Set ‘Public Path’ as web access path to served resources; should map to Hostname
- Check ‘Serve experiment scripts’
Configuring image hosting by external CDN
Images used in smarts features are hosted by default on Akamai. If upload to client-hosted CDN is configured, ‘Public Path’ is set and ‘Host images’ is checked, then the client-hosted CDN can be used to store images and serve them when Dynamic Content campaigns are rendered. Note that a folder named “images” must be set up on the client-side CDN in order for the images to upload and render properly.
A decision whether to use Akamai or client-hosted CDN for Smarts features is done upon uploading the image in the Dynamic Yield admin (and not on per-render basis).
Once everything is configured, the Dynamic Yield script onsite will need to be adjusted so its links point to your new CDN.
- For most implementations use the example below and make sure to adjust the red text to point to your CDN:
<script type="text/javascript" src="//INSERT YOUR CDN DATA HERE/api_dynamic.js"></script>
<script type="text/javascript" src="//INSERT YOUR CDN DATA HERE/api_static.js"></script>
- If you implemented Dynamic Yield via Magento, adjust your script directly in Magento as described in the implementation via Magento procedures.
Note: It is important to verify that your scripts are loading correctly by clicking on the new source link and confirming that you are receiving the same result as if clicking on the original link.