- Parses WordPress core, Yoast, Rank Math, SEOPress, Multilingual, and custom XML sitemaps into a persistent
PreloadJobStoreordered by drag-and-dropContentPriority. - Runs bounded Action Scheduler ticks (
MAX_BATCH_JOBS = 100) signed withPreloadProofPolicytokens and pauses automatically if permanent bypass headers are detected. - Proactively re-warms cached entries entering the final fifth of their TTL (
FileCache::nearExpiry) before real visitors ever hit a cold expiry. - Injects
<script id="kadicache-instant-links">(100mshover delay,3/secthrottle) with automatic CSP fallback and strict WooCommerce/logout route exclusions.
Table of Contents (5 sections)
Two Latency Gaps Even the Fastest Cache Must Solve#
A page cache—no matter how fast its advanced-cache.php drop-in runs—faces two structural moments where visitors still experience latency:
- The Cold-Cache Penalty After Purges or Deployments: Whenever you update your theme, change navigation menus, publish a storewide sale banner, or expire TTL windows overnight, cached snapshots invalidate. Without intelligent background warming, the very first organic shopper or Googlebot crawl on each URL pays the full 450 ms+ uncached PHP + MySQL render cost. Worse, naive preloaders that fire 500 unthrottled
wp_remote_get()requests in a tight loop spike CPU to 100% and trigger502 Bad Gatewayerrors on shared and mid-tier VPS hosting. - Inter-Page Navigation Latency: Even when every URL on your origin is warm (
14 msserver TTFB), a mobile shopper clicking from a category grid to a product page still pays 80 ms to 220 ms of cellular round-trip time, DNS/TLS framing, and HTML download before the browser can begin parsing the next document.
KadiCache closes the first gap on the server with Preloader.php and closes the second gap in the browser with InstantLinks.php.
Adaptive Sitemap Discovery & Drag-and-Drop ContentPriority#
When a warmup run starts in WP Admin -> KadiCache -> Preload (or automatically after a purge), PreloadDiscovery.php and SitemapXmlParser.php discover public URLs across WordPress core (/wp-sitemap.xml), Yoast SEO, Rank Math, SEOPress, All in One SEO, translated language-domain sitemaps (preload_language_domains), and any extra feeds listed in Additional Custom Sitemap URLs (CustomSitemaps.php).
Instead of warming low-value archive tags from 2019 ahead of your flagship revenue pages, ContentPriority.php orders PreloadJobStore jobs according to your drag-and-drop Content Priority list:
- Revenue-First Queue Ordering: Place Homepage & Core Landing Pages and WooCommerce Products at the top of the priority stack so money pages are warm within seconds of any full purge, followed by Posts, Categories, and Secondary Taxonomies.
- Multi-Representation Awareness: When
mobile_cache_enabledor multi-currency public representations (CurrencyContext.php) are active,Preloader::urlBudget()expands and budgets Desktop, Mobile, and currency variants deterministically without exceeding storage limits. - Cleanly Decoded Unicode & Arabic Queue View: Percent-encoded UTF-8 slugs (such as Arabic, Hebrew, Cyrillic, or CJK permalinks) are decoded cleanly inside the live Sitemap Warmup Queue table so multilingual editors can read every queued URL at a glance.
Bounded Workers, Cryptographic Loopback Proofs & Near-Expiry Renewal#
Preloader.php never spawns runaway background loops. Every cycle runs inside a cooperative Action Scheduler hook (kadicache_preload_tick) guarded by PreloadWorkerLock.php and capped at MAX_BATCH_JOBS = 100 jobs per bounded budget:
In addition to post-purge warming, Preloader::nearExpiry() works alongside FileCache::nearExpiry() to renew warm pages proactively when an entry enters the final fifth of its TTL lifetime—keeping high-traffic pages continuously hot with zero cold-expiry dips.
| Warmup Scenario | Naive Unbounded Crawler | No Preloader (Lazy Misses) | KadiCache Preloader.php |
|---|---|---|---|
| Post-purge Homepage & Top Products | Random XML order (often last) | Cold 500 ms miss for first shopper | Warmed first via ContentPriority |
| Origin CPU Impact on 2-vCPU VPS | Spikes PHP-FPM to 100% | Spikes during traffic bursts | Bounded ticks + PreloadWorkerLock |
Pages with DONOTCACHEPAGE | Retried wastefully every cycle | Re-rendered every visit | Classified via STABLE_BYPASS_REASONS |
| Approaching TTL Expiration | Expires cold, then re-crawls | Visitor hits cold rebuild | Renewed early via FileCache::nearExpiry |
InstantLinks.php: Zero-Leakage Hover & Touch Prefetching#
Once your origin cache is warm, Instant Links (instant_links_enabled) eliminates perceived network latency between pages. InstantLinks.php prints a tiny, minified script (id="kadicache-instant-links", marked data-kadicache-no-delay and data-kadicache-no-defer so Defer & Safe Delay JavaScript never delays link responsiveness) configured via data-kadicache-links JSON:
- 100 ms Hover Intent & Touchstart: Desktop links wait
onHoverDelay: 100ms of pointer hover before prefetching (filtering out accidental mouse sweeps across navigation bars), while mobile touch devices trigger ontouchstartjust before finger lift. - Strict
rateThrottle: 3Prefetches/Second: Caps concurrent background prefetches to at most 3 URLs per second and skips prefetching automatically when the visitor's browser reportsSave-Data: onor slow2gcellular connections. - CSP-Aware Automatic Fallback (
InstantLinks::finalize()): Inspects outboundContent-Security-Policyheaders and<meta>tags viaCspPolicy. If strictscript-srcrules block inline scripts without a matching nonce, KadiCache automatically converts#kadicache-instant-linksinto an externaldeferscript (assets/frontend/js/instant-links.js) instead of triggering browser console CSP violations!
Controlling Preload & Instant Links via WP-CLI#
Operators and CI/CD deployment pipelines can trigger, pause, resume, or inspect warmup queues directly through PreloadCli.php:
# View pending, warmed, and failed URL counts plus lock/pause diagnostics
wp kadicache preload status --format=json
# Queue a fresh discovery & warmup pass after deploying a new theme release
wp kadicache preload start
# Execute one bounded <=100-URL worker batch synchronously from cron or CI
wp kadicache preload run --url=https://example.com
# Temporarily pause or resume background ticks during server maintenance
wp kadicache preload pause
wp kadicache preload resumeCreator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.