Bobcares

LiteSpeed Cache and LSCache: Essential CDN Settings

by | Jul 5, 2024

Let’s take a look at how to configure CDN Settings in LiteSpeed Cache with LSCache. Our LiteSpeed Support team is here to help you with your questions and concerns.

LiteSpeed Cache and LSCache: Essential CDN Settings

Did you know that if you’re using a content delivery network you can easily configure LiteSpeed Cache for WordPress to work seamlessly with your CDN?

You are in luck! Our Experts are here with this step-by-step guide to help you get everything set up.

How to Enable QUIC.cloud CDN

  1. First, go to the LiteSpeed Cache settings in the WordPress dashboard.
  2. Then, turn the QUIC.cloud CDN option to ON. We do not need to do anything else on this page.

How to Set Up Custom CDN Mapping

  • CDN Path:

    This section lets us mention multiple CDN paths for your content. If we’re only using a single CDN, we only need to fill in the first box.

    However, if we have more than one path (for example, images served from one CDN, and JavaScript/CSS served from another), then we need to fill out a box for each path.

    Remember to enable multiple CDN paths for the content in case we have multiple paths.

  • CDN URL:

    Enter the base URL for the CDN content, starting with `http`.

  • Include Images:

    We can enable this option to serve all images through our CDN. This includes image attachments, HTML `<img>` tags, and CSS `url()` attributes.

  • Include CSS:

    Enable this option to serve all CSS files through the CDN.

  • Include JS:

    We can enable this option to serve all JavaScript files through our CDN.

  • Include File Types:

    We can use this option to list out file types to be served from our CDN one per line. These files should be static.

    Furthermore, this setting affects these HTML tags: src, date-src, and href.

Configure CDN with LiteSpeed Cache

Once we have set up our CDN on its website, we can easily configure it with the LSCache plugin:

  1. First, go to Settings Option under LiteSpeed Cache and select the CDN tab.
  2. Then, configure these options:
    • Original URLs: Enter the site’s original URI.
    • CDN URL: Enter the CDN URL.
    • File Types: Mention the static file types our CDN will serve.

Our experts would like to point out that our CDN should only serve static files. LSCache will handle caching for dynamic content.

How to Use Cloudflare with LiteSpeed Cache

If we are using Cloudflare, we can follow these steps:

  1. Make sure we have set up our Cloudflare account on the Cloudflare website.
  2. Then, go to the WordPress dashboard, and head to LiteSpeed Cache > CDN > CDN Settings.
  3. Update the following:
    • QUIC Cloud CDN: Off
    • Use CDN Mapping: Off
    • Cloudflare API: On, then fill in your Email Address, Global API Key, and Domain

Alternatively, if we do not want to manage Cloudflare through LSCache, we can set the Cloudflare API to “Off”. Cloudflare will work without any additional configuration in LSCache.

However, managing it through LSCache lets us purge our Cloudflare cache or enable Development Mode from within LSCache.

How to Set Up Other Reverse-Proxy CDNs

For other CDNs:

  • CNAME Setup:

    Follow the CDN’s instructions to set up a CNAME record (e.g., `cdn.example.com`).

  • LiteSpeed Cache CDN Settings:

    Go to LiteSpeed Cache > CDN > CDN Settings in the WordPress dashboard. Then, make these changes:

    • Set QUIC Cloud CDN and Cloudflare API to Off.
    • Turn Use CDN Mapping to On.
    • Enter the CDN URL.
    • Enter the Original URLs.

Once we save the changes, LiteSpeed Cache will substitute the CDN URL for the Original URL in static copies of our dynamically-generated code where needed.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

By following the above steps, our CDN and LiteSpeed Cache will be able to work together smoothly to deliver our content efficiently.

In brief, our Support Experts demonstrated how to configure CDN Settings in LiteSpeed Cache with LSCache.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.