Craft CDN Integration

This tutorial helps you to integrate KeyCDN into your Craft CMS installation.

  1. Create a pull zone before you start the Craft CDN integration.
  2. Login to your Craft control panel.
    craft cdn login
  3. Navigate to Assets.
    craft navigate to assets
  4. Create a new Source and define a name, file system path (e.g. assets/) and the URL (e.g. http://<zonename>-<hexUserId>.kxcdn.com/path/to/your/assets).
    craft create asset sourcecraft configure asset source
  5. Create the directory in your public directory according to the file system path that you have defined before and make sure it has write and read permissions.
  6. Upload your images to the defined asset source and integrate them in your entries wherever you want.
    craft upload assets
  7. Verify if the assets are loading from KeyCDN.
    craft verify cdn integration

If you already have your assets defined just replace the current URL with the Zone URL from the KeyCDN dashboard.

Furthermore, to automatically clear the KeyCDN cache for a particular asset once it has been updated/deleted or purge the entire zone directly from the control panel, you can make use of the KeyCDN Craft plugin available on Github.

Leave A Comment?