MegaHost Speed Stack: LiteSpeed + Bunny CDN for Instant Loading
At MegaHost, we’ve built a performance stack that makes sites feel like native apps — fast first load, instant page switching, and rock‑solid repeat visits. This guide documents the exact LiteSpeed origin configuration, Bunny CDN edge settings, long‑cache Edge Rule, and global cache warm‑up routine we use.
1. LiteSpeed Origin Optimisation
Before traffic even reaches BunnyCDN, the origin must be tuned for speed and cache‑friendliness.
LiteSpeed Settings:
- QUIC + HTTP/3: ON — matches BunnyCDN’s protocol support.
- Brotli Compression: ON — smaller payloads for text assets.
- LSCache Plugin (WordPress/Joomla/etc.):
- Cache TTL: 1 day for HTML pages (dynamic content).
- Static File TTL: 1 year for versioned assets.
- ESI (Edge Side Includes): ON for personalised fragments.
- CSS/JS Minify & Combine: ON — but avoid double‑minifying if Bunny CDN also does it.
- Image Optimisation: ON — WebP/AVIF generation.
- Purge Rules: Purge only changed assets/pages, not the entire cache.
Why this matters: A clean, cache‑friendly origin ensures BunnyCDN can store and serve assets without revalidation delays.
2. Bunny CDN Performance Settings
Setting | Value | Why It Matters |
---|---|---|
Origin Shield | ON — closest to origin | Reduces origin hits, speeds cache fills |
Tiered Caching | ON | Edges pull from shield, not origin |
SmartEdge Routing | ON | Routes visitors to fastest edge |
HTTP/3 + QUIC | ON | Faster connection setup |
Brotli Compression | ON | Smaller text asset sizes |
Image Optimisation | ON (WebP/AVIF) | Smaller, faster images |
3. Long‑Cache Edge Rule
From your Bunny CDN dashboard:
Rule Name: long-cache
Action: Set Response Header
Cache-Control: public, max-age=31536000, immutable
Condition:
Request URL matches /wp-content/{uploads,themes,plugins}/*
Effect:
- Browser: Keeps assets for 1 year without revalidation.
- CDN Edge: Serves instantly from cache.
- User Experience: Instant page switching after first load.


Click SAVE
💡 Tip: If you want to confirm it’s working, request one of those URLs in your browser and check the Response Headers in DevTools — you should see Cache-Control: public, max-age=31536000, immutable
.

4. Why This Delivers Instant Page Switching
- First page view: Assets fetched from nearest Bunny CDN edge.
- Subsequent views: Browser loads from memory — zero network calls.
- Result: Navigation feels like a native app.
5. Global Cache Warm‑Up Script
Even with perfect caching, a cold edge can slow the first visitor in a region. We pre‑fill Bunny CDN’s edges before launch or testing:
#!/bin/bash
DOMAIN="https://cdn.megahost.xyz"
ASSETS=(
"/"
"/about/"
"/contact/"
"/wp-content/themes/megahost/style.v3.css"
"/wp-content/themes/megahost/main.v2.js"
"/wp-content/uploads/2025/hero-banner.webp"
)
REGIONS=(
"ny" "la" "sg" "de" "uk" "jp" "au"
)
for region in "${REGIONS[@]}"; do
for asset in "${ASSETS[@]}"; do
echo "Warming $asset via $region..."
curl -s -o /dev/null -H "Host: cdn.megahost.xyz" \
--resolve "cdn.megahost.xyz:443:POP_IP_FOR_$region" \
"$DOMAIN$asset"
done
done
echo "✅ Cache warm-up complete."
Steps:
- Replace
POP_IP_FOR_$region
with actual Bunny CDN PoP IPs. - Run from a server with good outbound bandwidth.
- Confirm HIT status in Bunny CDN dashboard.
6. LiteSpeed + Bunny CDN Integration Checklist
DNS & SSL
- [ ] Point CDN hostname (e.g.,
cdn.megahost.xyz
) to Bunny CDN Pull Zone. - [ ] Enable Let’s Encrypt SSL in Bunny CDN for HTTPS delivery.
Origin Settings
- [ ] Set origin URL to LiteSpeed server.
- [ ] Enable Origin Shield (closest to LiteSpeed server).
Caching
- [ ] LiteSpeed: HTML TTL = 1 day, Static TTL = 1 year (versioned assets).
- [ ] Bunny CDN: Ignore origin cache headers for static paths.
- [ ] Apply
long-cache
Edge Rule.
Compression & Protocols
- [ ] Enable Brotli & HTTP/3 on both LiteSpeed and Bunny CDN.
Asset Optimisation
- [ ] Minify CSS/JS in LiteSpeed or Bunny CDN (not both).
- [ ] Enable WebP/AVIF in LiteSpeed or Bunny CDN.
Testing
- [ ] Warm up Bunny CDN edges globally.
- [ ] Test with Pingdom, GTmetrix, Lighthouse (first & repeat views).
Final Word
With this LiteSpeed + Bunny CDN Speed Stack, you’re not just optimising for benchmarks — you’re delivering a perceptible, real‑world speed boost that keeps visitors engaged and reduces bounce rates.