> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate a CDN resource with SocialEngine

SocialEngine can rewrite static file URLs to a CDN base URL. Configure a Gcore CDN resource to cache and deliver JavaScript, CSS, and other supported static files from a location closer to site visitors.

<Info>
  These instructions apply to self-hosted SocialEngine 6.7 and later. Back up the site files and database before changing performance settings.
</Info>

<Steps>
  <Step title="Prepare the CDN resource">
    In the Gcore Customer Portal, create a [CDN resource](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource) with the SocialEngine site as its origin.

    Add a [custom domain](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) — `cdn.example.com` — and enable HTTPS. Confirm that the CDN domain can retrieve a representative CSS or JavaScript file from the origin.
  </Step>

  <Step title="Open Performance & Caching">
    Sign in to the SocialEngine Control Panel and navigate to **Settings** > **Performance & Caching**.
  </Step>

  <Step title="Set the static file base URL">
    In **Static File Base URL**, enter the complete HTTPS URL for the custom CDN domain — `https://cdn.example.com`.

    Do not add a trailing slash.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-socialengine/integrate-cdn-resource-with-socialengine-image1.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=44420ceb4fcae60c012d1bc3aac80ec7" alt="Static File Base URL set to a documentation-safe CDN domain" width="1100" height="144" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-socialengine/integrate-cdn-resource-with-socialengine-image1.png" />
    </Frame>
  </Step>

  <Step title="Save and flush the cache">
    Select **Flush cache?**, and then select **Save Changes**.
  </Step>

  <Step title="Verify CDN delivery">
    Open the site in a private browser window. Open the browser developer tools, select **Network**, and reload the page.

    Filter requests by `cdn.example.com`. Confirm that JavaScript and CSS files use the CDN URL and return successful HTTP responses.
  </Step>
</Steps>

## Troubleshooting

When static files fail to load from the CDN hostname, the cause is usually a missing origin path, an origin connectivity error, a TLS or CORS block, a cache that still serves the previous URL, or a file type that SocialEngine does not rewrite.

* For a `404` response, confirm that each requested path exists on the origin and can be retrieved through the CDN domain.
* For a `502` response, check the origin hostname, pull protocol, port, and host header in the CDN resource.
* If the browser blocks requests, confirm that the CDN domain has a valid TLS certificate and returns the required CORS headers.
* If old asset URLs remain visible, select **Flush cache?**, save the settings again, and [purge CDN cache](/cdn/clear-cdn-resource-cache-by-url-pattern-or-all).
* If only some files use the CDN, the setting applies to static files supported by SocialEngine. Custom absolute URLs and plugin-generated paths might require separate configuration.
