> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wpstratos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate a CDN with Aero for Global Asset Delivery

> Connect your own CDN to Aero on WP Stratos. Rewrite static asset URLs to a CDN hostname and deliver images, CSS, and JS from global edge locations.

Aero's CDN integration rewrites the URLs of your site's static assets — images, CSS files, and JavaScript files — so they are served from a Content Delivery Network instead of directly from your WP Stratos origin server. Delivering assets from CDN edge nodes closest to each visitor reduces latency, speeds up page loads, and offloads bandwidth from your origin server. Aero uses a bring-your-own-CDN model: you set up an account with any CDN provider that supports pull zones, and Aero handles the URL rewriting automatically.

## How It Works

When CDN integration is enabled, Aero scans the HTML of each page it serves and replaces the hostname in static asset URLs with your CDN delivery hostname. For example, an image at `https://yoursite.com/wp-content/uploads/photo.jpg` becomes `https://cdn.yoursite.com/wp-content/uploads/photo.jpg`. The CDN pulls that file from your origin the first time it is requested from each edge location, caches it, and serves it locally to all subsequent visitors in that region — without touching your WP Stratos server.

## Prerequisites

<Note>
  Before configuring CDN integration in Aero, you need a CDN account with a **pull zone** set up to pull content from your WP Stratos site's domain. The pull zone tells your CDN where to fetch assets when they aren't already cached at the edge. Refer to your CDN provider's documentation for instructions on creating a pull zone.
</Note>

## Setting Up CDN Integration

<Steps>
  <Step title="Create a pull zone with your CDN provider">
    Log in to your CDN provider's dashboard (Cloudflare, BunnyCDN, KeyCDN, or any compatible provider) and create a new pull zone. Set the **origin URL** to your WP Stratos site's primary domain (e.g., `https://yoursite.com`). Save the pull zone and wait for it to become active.
  </Step>

  <Step title="Copy your CDN delivery hostname">
    Once the pull zone is active, your CDN provider will give you a delivery hostname. This is either a provider subdomain (e.g., `yourzone.b-cdn.net`) or a custom hostname you've mapped via CNAME (e.g., `cdn.yoursite.com`). Copy this value — you'll paste it into Aero in the next step.
  </Step>

  <Step title="Open Aero's CDN settings">
    In your WordPress Admin, go to **Aero → CDN**.
  </Step>

  <Step title="Enter your CDN hostname">
    Paste your CDN delivery hostname into the **CDN URL** field. Enter only the hostname — no trailing slash and no path. For example: `cdn.yoursite.com` or `yourzone.b-cdn.net`.
  </Step>

  <Step title="Enable CDN rewriting">
    Toggle **Enable CDN Rewriting** to on. You can also choose which asset types to rewrite — images, CSS, JavaScript, or all of the above — using the checkboxes below the toggle.
  </Step>

  <Step title="Save and purge the cache">
    Click **Save Changes**, then purge Aero's full page cache so all pages are re-rendered with the new CDN URLs. Use the **Purge Cache** button in the admin bar or go to **Aero → Cache → Purge All**.
  </Step>

  <Step title="Verify CDN delivery">
    Open your site in a browser, right-click any image, and select **Copy image address**. The URL should show your CDN hostname instead of your site's domain. You can also open your browser's developer tools, go to the **Network** tab, and confirm that image and asset requests are being served from your CDN hostname.
  </Step>
</Steps>

## CDN Exclusions

Not all file types need CDN delivery. To exclude specific file extensions or URL paths from being rewritten, navigate to **Aero → CDN → Exclusions**. Enter file extensions (e.g., `.php`, `.xml`) or URL patterns (e.g., `/wp-admin/*`) to prevent Aero from rewriting those URLs. Exclusions are useful for dynamic files that must always be served from the origin, or for assets that are already handled by a separate CDN rule.

## Provider Setup Notes

<Tabs>
  <Tab title="Cloudflare">
    If you're using Cloudflare, create a **CNAME record** in your DNS that points your CDN subdomain (e.g., `cdn.yoursite.com`) to the Cloudflare zone hostname assigned to your pull zone. Enter that CNAME hostname in Aero's CDN URL field.

    Note that Cloudflare's **proxy feature** (the orange cloud toggle in your DNS settings) is a separate function from Aero's CDN URL rewriting — it controls whether Cloudflare proxies your main site traffic, and does not need to be enabled or disabled specifically for this integration. The Aero CDN integration only rewrites static asset URLs and works independently of the proxy setting on your root domain.
  </Tab>

  <Tab title="BunnyCDN">
    In the BunnyCDN dashboard, create a new **Pull Zone** and set the origin URL to your WP Stratos site domain. BunnyCDN will provision a delivery hostname in the format `yourzone.b-cdn.net` — copy this and paste it into Aero's **CDN URL** field.

    If you want to use a branded hostname (e.g., `cdn.yoursite.com`), add a custom hostname in BunnyCDN's Pull Zone settings and create the corresponding CNAME record in your DNS. Once the custom hostname is verified and active, use it in Aero instead of the `b-cdn.net` hostname.
  </Tab>

  <Tab title="KeyCDN">
    In the KeyCDN dashboard, create a new **Pull Zone** and set the origin to your WP Stratos site URL. KeyCDN provides a zone alias hostname in the format `yourzone-yourzone.kxcdn.com`. You can use this directly in Aero's **CDN URL** field, or configure a **Zone Alias** (custom hostname) in KeyCDN and point a CNAME record to your zone URL.

    Once your zone is active and the hostname resolves correctly, enter it in Aero's CDN URL field, save, and purge your cache to begin serving assets from KeyCDN's edge network.
  </Tab>
</Tabs>

<Tip>
  After enabling CDN integration and saving your settings, always purge Aero's cache immediately. Cached pages still contain the old (origin) asset URLs — a cache purge ensures that all pages are re-rendered with the CDN hostname rewritten in, so visitors start benefiting from CDN delivery right away.
</Tip>


## Related topics

- [Aero: Caching and Performance for WP Stratos Sites](/plugins/aero/overview.md)
- [WP Stratos: Get Your WordPress Site Live in Minutes](/quickstart.md)
- [Resolve Aero Caching Problems on WP Stratos Hosting](/troubleshooting/cache-issues.md)
- [Configure Page Caching in Aero for Faster Load Times](/plugins/aero/caching.md)
- [Optimize Your WordPress Site with Aero's Speed Tools](/plugins/aero/optimization.md)
