LiteSpeed

Use any pull CDN with LiteSpeed Cache (CDN mapping)

Connect LiteSpeed Cache to a pull CDN such as BunnyCDN or KeyCDN with CDN mapping: create the pull zone, map file types to the CDN URL, test, and purge correctly.

IntermediateWordPress on LiteSpeed2 min read

Besides QUIC.cloud and Cloudflare, LiteSpeed Cache can work with any "pull" CDN. A pull CDN fetches files from your site the first time they are requested and serves them from its edge after that. With CDN mapping, the plugin rewrites image, CSS and JavaScript URLs to the CDN hostname.

Before you start

Create a pull zone at the CDN

  1. In the CDN dashboard, create a pull zone with your site URL as the origin, for example https://example.com.
  2. Note the CDN hostname, for example example.b-cdn.net, or add a custom hostname like cdn.example.com with a CNAME record in your DNS zone (see DNS zone management).
  3. Enable SSL for the CDN hostname in the CDN dashboard.

Map files in LiteSpeed Cache

  1. Go to LiteSpeed Cache → CDN → CDN Settings.
  2. Turn Use CDN Mapping on.
  3. Enter the CDN URL, for example https://cdn.example.com/.
  4. Tick Include Images, Include CSS and Include JS.
  5. Leave Include File Types at the defaults unless you serve fonts or other files that should go through the CDN.
  6. Save and click Purge All.

Note: Page HTML still comes from your server and LiteSpeed Cache; the CDN serves static files. This combination gives fast pages and fast assets without HTML caching complications.

Test it

  • Open the site, view the page source and check that image and CSS URLs start with the CDN hostname.
  • In DevTools Network, confirm those files load with a 200 status from the CDN.

Purging

When you change a theme file or replace an image with the same name, purge the CDN in its dashboard as well. Many CDNs offer an API key that some plugins can use; otherwise purge manually after big changes.

Troubleshooting

Fonts or icons missing

Browsers block cross-domain fonts without CORS headers. Enable CORS in the CDN settings, or add an Access-Control-Allow-Origin header for font files.

Mixed content warnings

The CDN URL starts with http://. Use https:// and enable SSL for the CDN hostname.

Compare options in QUIC.cloud CDN and Cloudflare with LiteSpeed Cache.

Frequently asked questions

Does a pull CDN cost money?

Most charge per GB of traffic. For small sites it is usually inexpensive; check your provider's pricing.

Can I use CDN mapping and Cloudflare together?

You can, but it is unnecessary. Pick one CDN for static files to keep things simple.

Will images still be optimised?

Yes. LiteSpeed's image optimisation creates WebP files on your server, which the CDN then pulls and serves.

Should I use a custom CDN hostname?

A hostname on your own domain, like cdn.example.com, looks cleaner and lets you switch CDN providers without changing URLs.

Do I need to exclude anything from the CDN?

Files that must always come from your server, such as dynamic scripts, should not be mapped. The defaults cover static files only.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.