How to Use LiteSpeed Cache with Cloudflare Without Double Caching (Best WordPress Setup)

Here’s the best and clean way to use LiteSpeed Cache (LSC) for caching ONLY and Cloudflare strictly as a CDN — without double caching or conflicts. How to Properly Configure LiteSpeed Cache with Cloudflare to Avoid Double Caching in WordPress


Goal

  • LiteSpeed Cache → full page caching + optimization (HTML, CSS, JS, images)

  • Cloudflare → CDN + DNS only (no caching of HTML pages)


Step-by-Step Setup (Avoid Double Caching)

1️⃣ Cloudflare Settings (Set for CDN Only)

A. Turn OFF page caching at Cloudflare

Go to:

Cloudflare Dashboard → Caching → Configuration

  • Disable “Cache Everything” (if active)

  • Disable “Edge Cache” / “Smart Edge Cache”

  • Disable “Automatic Platform Optimization (APO)” (very important!)

B. Page Rules (Optional but recommended)

If you accidentally enabled caching, reset it:

Page Rule → for yourdomain.com/
➡️ Cache Level: Standard (Default)
➡️ Disable Performance (optional)
➡️ Disable Apps (optional)

C. Turn OFF Cloudflare Rocket Loader

Cloudflare → Speed → Optimization

  • Rocket Loader → ❌ OFF
    (Elementor & JS-heavy sites break when this is ON)

D. Browser Cache TTL

Cloudflare → Caching → Configuration

  • Browser Cache TTL → Respect Existing Headers

This lets LiteSpeed control cache headers instead of Cloudflare.


2️⃣ LiteSpeed Cache Settings (LSC for Caching Only)

A. Enable LiteSpeed Server Cache

LSCache → Cache → Cache

  • Enable Cache → ON

  • Cache Mobile → ON

  • Cache Logged-in Users → OFF (optional)

B. Important: Disable LiteSpeed QUIC.cloud CDN

LSCache → CDN

  • QUIC.cloud CDN → ❌ Disable

  • QUIC.cloud DNS → ❌ Do NOT use
    (You are using Cloudflare as CDN already)

C. Use Only Local Optimization (No QUIC Cloud Services)

LSCache → Image Optimization

  • Disable “Use QUIC.cloud servers for optimization” (optional)

D. ESI Setting

LSCache → ESI → Keep default ON


3️⃣ To absolutely avoid Cloudflare caching HTML

Add this rule in Cloudflare → Rules → Page Rules:

🚫 Rule to prevent Cloudflare HTML caching

URL: yourdomain.com/*
Setting:
Cache Level: Bypass

Cloudflare will serve ONLY static files (images, CSS, JS) from CDN.
LSCache will handle full-page cache.


🔍 4️⃣ Ensure your site is actually served by LSCache

Install LiteSpeed Cache plugin → Toolbox → Report
Check “LiteSpeed Cache Status”
You MUST see:

X-LiteSpeed-Cache: hit
❌ Not: “miss” / “no-cache”

If it’s not showing “hit” → I can help fix.


🧪 5️⃣ Test correctly

Use these tools:

Page Cache Test

1️⃣ Open private/incognito window
2️⃣ Refresh same page 2–3 times
3️⃣ Check response headers:

Should show:
x-litespeed-cache: hit

Speed Test

Use:

  • GTmetrix (Canada server)

  • PageSpeed Insights

  • Cloudflare test: speed.cloudflare.com


⭐ Recommended Best Setup

ServiceResponsibility
LiteSpeed CacheFull page cache, CSS/JS optimization, HTML/minify, Image optimization
CloudflareCDN for images, CSS, JS + DNS + security
Elementor ProPage builder
HostingerHosting server

This is the ideal modern WP setup for fastest performance.

Scroll to Top