⚙️ Official High-Performance Engineering Manual

Ultimate Cloudflare & LiteSpeed Cache Guide for WooCommerce

Abancay Suite (Theme 1.7.2 + Core 1.1.2 + Smart Plugins)

Production-tested technical manual for WooCommerce stores with extensive catalogs. Learn how to eliminate 100% hosting CPU saturation from aggressive bot crawling, deliver lightning-fast responses globally in under 50 ms via Cloudflare Edge Cache, and secure green Google PageSpeed Core Web Vitals without breaking product carousels, live search, or mobile megamenus.

Validated Suite Compatibility Abancay 1.7.2 · Core 1.1.2 · MegaMenu 1.5.3 · Category Exp 2.4.5 · Smart Search 2.1.5 · Gallery 2.6.1
Server & Network Stack LiteSpeed Web Server Enterprise / OpenLiteSpeed + Cloudflare Edge (Free or Pro)
Section 01

1. Introduction & 2-Layer Cache Architecture

For an e-commerce catalog with thousands of WooCommerce items to deliver instant response times for shoppers and pass Google Core Web Vitals, it must run on a decoupled dual-layer architecture:

🌐 [ Shoppers / Googlebot / PageSpeed Insights ]
▼ Initial Request

LAYER 1: CLOUDFLARE EDGE CDN (Global Edge Network)

Zero Hosting CPU
  • Delivers static assets and fully cached public HTML in < 50 ms worldwide.
  • Absorbs bot floods, scrapers, and malicious scans right at the network perimeter.
  • Consumes 0% CPU and 0 MB RAM on your origin hosting server.
▼ Dynamic requests only (Cart, Checkout, My Account, AJAX) or fresh cache misses

LAYER 2: LITESPEED CACHE (Origin Web Server)

High-Speed RAM
  • Serves uncached pages directly from kernel RAM before WordPress boots.
  • Generates next-gen WebP images and handles clean local minification without duplicate inodes.
  • Shields the MySQL database from repetitive queries for category archives and product grids.
📊 Real-World Benchmark: Under this dual-layer setup, between 85% and 95% of all inbound requests are resolved at Cloudflare's edge. PHP and MySQL only execute when a shopper actively adds an item to cart or checks out, keeping hosting CPU load below 10-15% even during aggressive automated crawls.
Section 02

2. Surgical LiteSpeed Cache Configuration in WordPress

Log in to your WordPress admin panel and open the LiteSpeed Cache menu:

2.1. General Settings & Guest Mode

Setting / OptionRequired StatusTechnical Purpose
Enable LiteSpeed CacheONEnables server-level page caching at the LiteSpeed web server layer.
Cache MobileONGenerates separate cache files for mobile devices, ensuring responsive layouts load cleanly.
Guest ModeOFFCRITICAL: Prevents double requests and background file bloat.
Guest OptimizationOFFCRITICAL: Prevents background CSS/JS generation for guest variations.
⚠️ Why must Guest Mode and Guest Optimization remain OFF? On stores featuring extensive product catalogs, dynamic AJAX carousels, and megamenus, Guest Mode triggers a double HTTP request (via guest.vary.php) for every first-time visitor. Simultaneously, it launches aggressive background processes to compile individual CSS/JS files for each URL variation. In real production stores, this results in tens of gigabytes of disk space consumed in hours, complete inode exhaustion, and server lockups. Keeping both OFF is essential for long-term server health.

2.2. Page Optimization → CSS Settings

Option in [1] CSS SettingsRequired StatusEngineering Justification
CSS MinifyONSafely removes comments and whitespace from CSS files, shrinking payload sizes without breaking code.
CSS CombineOFFObsolete under HTTP/2 & HTTP/3. Combining creates heavy monolithic bundles that block initial render and break cache invalidation.
Generate UCSS (Unused CSS)OFFSpawns massive background queues of 500+ URLs that saturate CPU and database resources.
Load CSS AsynchronouslyOFFPrevents Flash of Unstyled Content (FOUC), layout shifts, and missing styles on initial render.
Async CSS LibraryOFFPrevents render-tree race conditions during CSS parsing.
Font Display OptimizationSwapInjects font-display: swap; across all webfonts, resolving Google PageSpeed font loading diagnostics.
⚡ The Abancay Advantage: Modular CSS Architecture
  • Zero need for CSS Combine: Abancay Suite plugins load lightweight modular stylesheets strictly where needed. Over Cloudflare HTTP/2 & HTTP/3 multiplexing, the browser downloads them in parallel across a single connection without rendering bottlenecks.
  • Higher cache retention: Updating a single plugin only invalidates that small asset; the rest of your storefront's styles remain permanently cached in shoppers' browsers and across Cloudflare's edge.
  • Clean by design: The suite ships without dead code, removing any requirement for CPU-heavy UCSS extraction.

2.3. Page Optimization → JS Settings & Critical Exclusions

JavaScript deferral is where many WooCommerce stores break if not configured surgically. Follow these exact settings across both the JS Settings and Tuning / Excludes tabs:

Tab / OptionRequired StatusTechnical Purpose
[2] JS Settings → JS MinifyONMinifies JavaScript files cleanly, stripping unnecessary whitespace.
[2] JS Settings → JS CombineOFFPrevents breaking product slider loops, megamenu dropdowns, and WooCommerce AJAX checkout nonces.
[2] JS Settings → Load JS DeferredDeferredDefers non-critical JavaScript to execute after DOM parsing, eliminating PageSpeed render-blocking warnings.
🚨 Critical Requirement in [4] Tuning Settings → "JS Deferred / Delayed Excludes":

LiteSpeed has two distinct exclusion boxes: "JS Excludes" (which only bypasses minification) and "JS Deferred / Delayed Excludes" (which ensures scripts load synchronously without delay). You MUST add the following lines to "JS Deferred / Delayed Excludes":

jquery
jquery.min.js
jquery-core
jquery.blockUI
💡 Deep Technical Insight: If jQuery is excluded from Defer, does deferring JS still help?

YES, ENORMOUSLY! Many developers wrongly assume that excluding jQuery ruins the benefit of deferring JavaScript. Here is why this surgical exclusion is the industry-standard high-performance configuration:

  • Why jQuery must load first: Inline HTML snippets, WooCommerce add-ons, and payment gateways execute script blocks that immediately call jQuery(...) or $(...).block(...). If jQuery is deferred to the end of the page, those scripts execute before jQuery exists, throwing fatal console errors: Uncaught ReferenceError: jQuery is not defined or TypeError: $(...).block is not a function.
  • jQuery is lightweight (~30 KB gzipped): Loading jQuery synchronously introduces negligible overhead on modern broadband and 4G/5G connections.
  • The other 90% of JS weight remains deferred: Product sliders, analytics trackers, heavy plugin libraries, variations handlers, and WooCommerce cart fragments (amounting to 300 KB – 800 KB of scripts) stay deferred! They do NOT block the browser's critical rendering path, clearing Google PageSpeed's warning: "Eliminate render-blocking resources" while keeping 100% of site features working reliably.

Alternative Zero-Config Option: If you prefer not to manage script exclusions, set Load JS Deferred: OFF. Trade-off: You avoid script timing conflicts entirely, but Google PageSpeed will display an orange/red render-blocking diagnostic.

2.4. Image Optimization and WebP Conversion

⚠️ Critical Conflict Prevention: If you have third-party compression plugins active (such as Smush, Smush Pro, Imagify, EWWW, or ShortPixel), deactivate them immediately. Running two image optimization engines simultaneously causes competing .htaccess rewrite rules, broken image links, and doubled disk storage consumption.

Under LiteSpeed Cache → Image Optimization → [2] Image Optimization Settings:

Image SettingRecommended ValueEngineering Justification
Auto Request CronOFFPrevents background WordPress cron loops from constantly hitting QUIC.cloud and burning origin CPU.
Optimize Original ImagesONCompresses source JPG and PNG files without visible quality degradation.
Remove Original BackupsOFFRetains original uncompressed files as a safety backup.
Create WebP VersionsONConverts media into next-gen WebP format, reducing image weight by 40% to 70%.
Image WebP ReplacementONReplaces standard JPG/PNG sources with lightweight WebP versions in the output HTML.
Preserve EXIF/XMP DataOFFStrips unnecessary camera metadata, geolocation coordinates, and timestamps to save bytes.
WebP/AVIF for Extra srcsetONEnsures responsive image srcset attributes deliver next-gen WebP versions to mobile screens.
💡 Recommended Workflow: Under [1] Image Optimization Summary, click “Send Optimization Request” manually in controlled batches after uploading product lines or seasonal banners.

2.5. WooCommerce Cache Settings

Under LiteSpeed Cache → Cache → [7] WooCommerce:

  • Ensure Cart, Checkout, and My Account pages are excluded from page caching (LiteSpeed auto-detects standard WooCommerce endpoints).
  • Verify that Product Update Purge includes category archives and the front page so inventory and pricing updates reflect immediately.
Section 03

3. Cloudflare Network & Speed Configuration

Log in to your Cloudflare dashboard and select your store’s active domain:

3.1. Essential Clarification: "Auto Minify" Deprecation

ℹ️ Official Notice: Cloudflare globally deprecated the legacy “Auto Minify” feature in August 2024. Do not waste time looking for it in Cloudflare menus. Code minification is now handled with superior precision directly at the origin by LiteSpeed Cache, avoiding edge-level syntax mangling.

3.2. Speed, Compression, and Modern Protocols

Step A
Speed → Optimization → Content Optimization
  • Brotli Compression: ON — Compresses HTML, CSS, and JS 15% to 25% tighter than legacy Gzip.
  • Early Hints (103): ON — Allows browsers to preload critical CSS and fonts while the backend prepares the HTML.
Step B
Network Protocols
  • HTTP/3 (with QUIC): ON — UDP-based transport resilient to mobile packet loss, delivering 0-RTT handshakes and zero head-of-line blocking.
  • 0-RTT Connection Resumption: ON — Accelerates reconnection for returning shoppers by eliminating network round trips.

3.3. Smart Tiered Cache Topology

Under Caching → Tiered Cache:

  • Enable Smart Tiered Cache Topology: ON
Why is Tiered Cache vital for e-commerce? Cloudflare utilizes regional upper-tier data centers. If a shopper in Europe visits an image or category page previously fetched by someone in the US or Latin America, Cloudflare delivers it from its internal backbone network instead of making another trip to your hosting server. This cuts origin cache misses by up to 60% to 80%.
Section 04

4. Cloudflare Cache Rules (HTML Edge Caching)

By default, Cloudflare only caches static files (images, CSS, JS). This rule instructs Cloudflare to cache public HTML pages (homepage, category archives, product listings, blog posts) at the edge, while strictly bypassing administrative areas, user carts, checkout pages, and logged-in sessions.

Setup
  1. In Cloudflare, go to Caching → Cache Rules and click Create rule.
  2. Rule Name: Cache HTML Abancay Suite Store.
  3. Under "When incoming requests match...", select Custom filter expression and click Edit expression.
  4. Copy and paste the production expression below:
Cloudflare Cache Rules Expression (WooCommerce Safe)
(
  http.request.method in {"GET" "HEAD"}
  and not starts_with(http.request.uri.path, "/wp-admin")
  and not starts_with(http.request.uri.path, "/wp-login.php")
  and not starts_with(http.request.uri.path, "/carrito")
  and not starts_with(http.request.uri.path, "/finalizar-compra")
  and not starts_with(http.request.uri.path, "/mi-cuenta")
  and not starts_with(http.request.uri.path, "/cart")
  and not starts_with(http.request.uri.path, "/checkout")
  and not starts_with(http.request.uri.path, "/my-account")
  and not http.cookie contains "woocommerce_items_in_cart"
  and not http.cookie contains "woocommerce_cart_hash"
  and not http.cookie contains "wp_woocommerce_session"
  and not http.cookie contains "wordpress_logged_in"
)

In the bottom fields of the rule, configure:

Cache SettingRequired ValueTechnical Meaning
Cache eligibilityEligible for cacheInstructs Cloudflare's edge proxy to store matching HTML responses.
Edge Cache TTLIgnore cache-control header → 4 hoursStores public pages on edge servers for 4 hours. Can be higher if catalog updates infrequently.
Browser Cache TTLRespect origin headersAllows shoppers' browsers to receive fresh updates when your server flushes cache.
🚀 Click Deploy to activate HTML edge caching. Public pages will now serve in < 50 ms.
Section 05

5. Cloudflare WAF Security Rules (5-Rule Budget Optimization)

Cloudflare's Free tier includes up to 5 Custom WAF Rules. With these 3 consolidated rules, you achieve complete perimeter protection against brute-force attacks, database injection, and bot saturation without spending extra budget or blocking legitimate buyers.

Navigate to Security → WAF → Custom Rules:

5.1. Rule 1: Block XML-RPC and Abusive AI Crawlers / Scrapers

Permanently blocks brute-force attacks against xmlrpc.php and terminates aggressive AI web indexers that exhaust server memory. Notice the explicit inclusion of meta-webindexer: during live testing, Meta's autonomous scraper generated hundreds of thousands of origin hits while evading default bot checks.

Rule NameBlock XML-RPC and AI Bots
ActionBlock
WAF Rule 1 Expression
(
  http.request.uri.path eq "/xmlrpc.php"
  or http.user_agent contains "meta-webindexer"
  or (
    http.request.uri.path ne "/robots.txt"
    and (
      http.user_agent contains "Amazonbot"
      or http.user_agent contains "Baiduspider"
      or http.user_agent contains "Bytespider"
      or http.user_agent contains "Claude-SearchBot"
      or http.user_agent contains "Claude-User"
      or http.user_agent contains "ClaudeBot"
      or http.user_agent contains "meta-externalagent"
      or http.user_agent contains "PetalBot"
      or http.user_agent contains "KeenAbleBot"
    )
  )
)

5.2. Rule 2: Abusive Search Query Filter

Stops automated query-flood attacks designed to crash MySQL through WordPress's legacy search URL (?s=++++++ or encoded character injections). This protects your database while leaving Abancay Smart Search's fast AJAX endpoint completely untouched.

Rule NameAbusive Search Filter
ActionBlock
WAF Rule 2 Expression
(
  http.request.uri.query contains "s="
  and not http.user_agent contains "Googlebot"
  and (
    http.request.uri.query contains "++++++"
    or http.request.uri.query contains "%D8"
    or http.request.uri.query contains "%D9"
  )
)

5.3. Rule 3: Geo Challenge with Surgical Exclusions (PageSpeed & Menu Bypass)

Applies a frictionless Managed Challenge to visitors arriving from outside your primary target market. Real shoppers pass seamlessly, while data-center scrapers and untracked bots are stopped at Cloudflare's perimeter.

🛡️ The 3 Essential Exclusions That Keep Your Store Flawless:
  • 1. Genuine Googlebot: Using cf.client.bot and Googlebot guarantees authentic Google indexing bots pass with zero resistance, protecting organic rankings.
  • 2. Google PageSpeed Insights (ASN 15169): PageSpeed runs headless Chrome from Google's data center network (ASN 15169). Without this exact exemption (ip.geoip.asnum eq 15169 and Chrome-Lighthouse), PageSpeed tests hit Cloudflare's challenge page, testing a blank security screen instead of your real store!
  • 3. Smart Megamenu Endpoints: Excludes /wp-json/abmm/v1/menu and action=abmm_menu so the dynamic mobile and desktop menus render instantly without challenge blocks.
💡 Country Selector: Choose your primary operating country
Clicking a button automatically updates the expression below with your target ISO-2 country code.
Rule NameInternational Challenge & Key Exclusions
ActionManaged Challenge
Rule 3 WAF Expression (With PageSpeed and Menu bypass)
(
  ip.src.country ne "PE"
  and not (cf.client.bot and (http.user_agent contains "Googlebot" or http.user_agent contains "Google-InspectionTool"))
  and not (ip.geoip.asnum eq 15169 and http.user_agent contains "Chrome-Lighthouse")
  and not starts_with(http.request.uri.path, "/wp-json/abmm/v1/menu")
  and not (
    http.request.uri.path eq "/wp-admin/admin-ajax.php"
    and http.request.uri.query contains "action=abmm_menu"
  )
)
Section 06

6. Critical Purge & Cache Synchronization Protocol

Whenever you update a theme, install a plugin update, or modify design elements, you must respect the exact sequence of cache purges. Failing to follow this order is the #1 cause of broken styling and missing asset errors.

6.1. Why do 404 Errors Happen After Updating Plugins?

🔍 The Technical Root Cause of Broken CSS / 404 Errors:

When CSS Minify: ON and JS Minify: ON are active in LiteSpeed Cache, LiteSpeed combines and hashes files under unique names, such as:
wp-content/litespeed/css/15bd3bf8e1da86...css

When you update a plugin (like Abancay Core or Category Experience), LiteSpeed regenerates or deletes those cached hashed files. However, Cloudflare's edge cache still holds the old HTML page referencing the deleted hash file names. When browsers visit the site, they request files that no longer exist on the server disk, resulting in 41+ HTTP 404 (Not Found) errors in DevTools and a completely unstyled layout!

The solution is NOT to turn off minification! You can safely keep CSS and JS minification ON by following the strict 3-step synchronization order below.

6.2. The 3-Step Synchronized Purge Protocol

Step 1
Origin Server First (LiteSpeed Cache)

In the WordPress top admin bar, click the LiteSpeed icon → "Purge All - LSCache".

✓ Cleans local server disk storage and cues LiteSpeed to compile fresh CSS/JS hash files on the next visit.
Step 2
Global Edge CDN Second (Cloudflare)

In the Cloudflare dashboard, navigate to Caching → Configuration → "Purge Everything".

✓ Clears Cloudflare's edge memory, forcing it to fetch fresh HTML containing the new, valid CSS/JS file names from your origin server.
Step 3
Browser Hard Refresh

Open an Incognito window, or press Ctrl + Shift + R (Cmd + Shift + R on Mac).

✓ Ensures your local browser bypasses its disk cache and displays the fresh storefront immediately.

6.3. What if Internal Pages Work but the Homepage Still Shows 404s?

💡 Resolving Stubborn Stale Homepage Cache:

Because the homepage (/) receives the highest traffic volume, Cloudflare edge nodes hold onto its cached HTML most aggressively. If internal category pages look perfect but the homepage appears broken after an update:

  1. In Cloudflare → Caching → Configuration → Purge by URL.
  2. Enter your exact homepage URL: https://yourdomain.com/ and click Purge.
  3. In Chrome: Open Developer Tools (F12), right-click the browser's Reload icon next to the address bar, and click "Empty Cache and Hard Reload".
Section 07

7. Verification & Live Testing Protocol

Once your configuration is in place, execute these 4 technical verification tests:

Test 1
Incognito Mobile Navigation & Cart Test
  • Open your store on a smartphone or Chrome DevTools Mobile View.
  • Open the mobile drawer menu and tap categories with deep tiers: verify the panel glides open smoothly with the sticky ‹ Categories back button and ✕ Close button.
  • Add a product to cart: verify the cart counter updates dynamically and that navigating to /cart and /checkout preserves your session cleanly.
Test 2
Chrome DevTools Console Audit
  • Open Chrome DevTools (F12) and navigate to the Console tab.
  • Verify that there are zero red 404 Not Found errors for CSS or JS files.
  • Verify that there are zero jQuery errors (such as jQuery is not defined or blockUI is not a function).
Test 3
Google PageSpeed Insights Audit
  • Run an audit for your store URL on Google PageSpeed Insights.
  • Inspect the filmstrip preview: You will see your real store's logo, banners, and hero grid (NOT the Cloudflare challenge screen, thanks to WAF Rule 3 ASN 15169 bypass!).
  • Confirm that FCP, LCP, and CLS are in green thresholds, with a TTFB under 150-200 ms powered by Cloudflare Edge Cache.
Test 4
Hosting Control Panel CPU Monitoring
  • Log in to your hosting control panel (cPanel, hPanel, Plesk, etc.).
  • Review the CPU usage graph: it will remain a low, stable line even during automated crawling and external visitor traffic.
Section 08

8. Interactive Implementation Checklist

Check off each step as you configure your store. Your progress saves automatically in this browser:

Optimization Progress 0 / 12 completed (0%)
Shopping Cart
Scroll to Top