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

# Integrate a CDN resource with SocialEngine

> Configure a Gcore CDN resource with SocialEngine to cache and deliver static JavaScript and CSS files through a custom HTTPS domain.

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.

> [!NOTE]
>
> These instructions apply to self-hosted SocialEngine 6.7 and later. Back up the site files and database before changing performance settings.

**1. 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.

**2. Open Performance & Caching**

Sign in to the SocialEngine Control Panel and navigate to **Settings** > **Performance & Caching**.

**3. 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.

![Static File Base URL set to a documentation-safe CDN domain](https://mintcdn.com/gcore/xuiVlU14_9S5W6tH/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=xuiVlU14_9S5W6tH\&q=85\&s=4c2ef99203b149a28fd76a82e485d2d1)

**4. Save and flush the cache**

Select **Flush cache?**, and then select **Save Changes**.

**5. 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.

## 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.
