Skip to main content

Integrate a CDN resource with PyroCMS 2.x

PyroCMS 2.x can serve static assets through a Orange's CDN resource by setting a custom domain in the admin panel's Integration settings.

Create a CDN resource before starting the integration. Configure its custom domain with a valid CNAME record and an active SSL certificate.

PyroCMS 2.x

This procedure assumes a PyroCMS 2.x installation with the standard local static-asset layout and an Integration CDN field in the admin panel.

Back up site files and the database before making changes.

  1. 1

    Locate the custom domain

    In the CDB Customer Portal, find the custom domain on the CDN resources page.

  2. 2

    Verify origin access

    Identify a known static asset used by the site. Request the same path directly from the protocol and hostname configured as the CDN origin:

    https://origin.example.com/path/to/known-asset.css
    

    Continue only after the origin returns the expected file without a 403 or 404 response.

  3. 3

    Open the Integration settings

    Log in to the PyroCMS admin panel and navigate to Settings > Integration.

  4. 4

    Set the CDN domain

    Enter the custom domain as a hostname without the protocol or trailing slash: cdn.site.com.

    This setting changes URLs generated through the PyroCMS Asset library. Update hardcoded asset URLs in templates separately because the Integration setting doesn't rewrite them.

  5. 5

    Apply the changes

    Click Save.

  6. 6

    Verify asset delivery

    Open the browser's developer tools by pressing F12, select the Network tab, and refresh the page. Asset-library-generated URLs should load from the custom domain instead of the origin domain.