Skip to main content
KadiCache
Browse 37 Docs Guides & Search

Smart Sitemap Preload, Content Priority & Bounded Warmup Queue

Warm cached HTML automatically from WordPress Core, Yoast, Rank Math, and custom XML sitemaps in priority order with single-worker lock protection and CPU pacing.

Preload/Preloader.phpPreload/PreloadDiscovery.phpPreload/ContentPriority.phpPreload/PreloadCli.php
WP Admin -> KadiCache -> Preload & Warmup
MODULE 10 · 2X RETINA
Adaptive Sitemap Preload queue with decoded Unicode/Arabic URLs, Speculation Rules Instant Links, and Resource Hints.2880×1840 WebP
Quick Summary · 30-Second Operational SpecSource-Verified Guide
WP Admin Path
WP Admin -> KadiCache -> Preload
Expected Outcome
98%+ First-Visit Warm HITs · Single-Worker CPU Lock
Key Marker / Engine
Preloader.php | ContentPriority.php | wp kadicache preload status
  • Automatically discovers WordPress Core (wp-sitemap.xml), Yoast SEO, Rank Math, SEOPress, and All in One SEO sitemaps (PreloadDiscovery.php) plus custom XML sitemap URLs (CustomSitemaps.php).
  • Warms URLs in business-impact priority order (ContentPriority.php)—Homepage & Key Landing Pages first, followed by WooCommerce Shop/Products, Recent Posts, and Taxonomy Archives.
  • Guards origin CPU and RAM via PreloadWorkerLock.php (strictly 1 active worker per site), bounded batch ticks, and automatic pause/backoff if server load or loopback errors occur.
  • Exposes full queue visibility (Pending, Warmed, Failed) in WP Admin -> KadiCache -> Preload and 5 CLI subcommands in PreloadCli.php (start, status, run, pause, resume).

Why Proactive Sitemap Warmup Matters After Purges & Deployments#

Without background cache preloading, the very first real human visitor (or Googlebot crawl!) to land on each product or blog URL after a cache purge, theme update, or TTL expiration pays the full 400 – 800 ms uncached PHP + MySQL render cost (X-KadiCache: MISS). On a WooCommerce store with 1,500 products where long-tail items receive 5 organic search visits per day, cold cache misses can drag down 20% to 35% of real-visitor TTFB and LCP samples!

Conversely, aggressive external crawler preloader plugins often spawn 10 parallel wp_remote_get() threads simultaneously right after a post update—pegging shared-hosting CPU cores at 100% and triggering 503 Service Unavailable or Cloudflare bot blocks.

KadiCache’s Smart Sitemap Preload Engine (Preloader.php, PreloadDiscovery.php, ContentPriority.php, and PreloadWorkerLock.php) gives you warm caches on first arrival with predictable, gentle server resource usage.

FIG 01Live Pending, Warmed, and Failed queue counters, Pause/Resume controls, and XML sitemap discovery inside WP Admin -> KadiCache -> PreloadZoom 2x

Automatic Sitemap Discovery & Priority Ordering (ContentPriority.php)#

When you enable Sitemap Preload inside WP Admin -> KadiCache -> Preload (or click Purge & Preload in the top bar), PreloadDiscovery.php and SitemapXmlParser.php build a deduplicated, policy-filtered warmup queue:

Warmup Tier (ContentPriority.php)URLs IncludedWhy This Order Matters
Priority 1 — Critical Entry RoutesHomepage (/), static Front/Blog page, WooCommerce main /shop/ archiveAbsorbs 40%–60% of immediate visitor arrivals within the first 3 seconds of a purge
Priority 2 — High-Value Pages & ProductsTop-level Pages & published WooCommerce Products (ContentPriorityDiscovery.php)Keeps revenue-generating product landing pages and ad targets warm first
Priority 3 — Recent Articles & PostsRecently published/updated blog posts ordered by recencyProtects fresh editorial traffic shared on social media & newsletters
Priority 4 — Taxonomies & Sitemap TailProduct categories, blog categories, tags & custom XML sitemapsCompletes long-tail organic SEO coverage cleanly in the background

UrlPolicy.php automatically filters out any URL matching your Excluded URL Paths, per-post Never cache this page rules (PostSettings.php), private WooCommerce cart/checkout pages, or off-origin links—so the preloader never wastes a single HTTP loopback request on an uncacheable route!

FIG 02Prioritizing critical pages, products, posts, and custom XML sitemap feeds inside WP Admin -> KadiCache -> PreloadZoom 2x

Single-Worker Lock & Origin CPU Pacing (PreloadWorkerLock.php)#

Every background warmup batch in KadiCache obeys four strict production safety guardrails:

  1. Exclusive Single-Worker Lock (PreloadWorkerLock.php): Even if WP-Cron, Action Scheduler, and a manual CLI tick fire at the same moment, only one preload worker can hold the site lock—preventing parallel loopback stampedes.
  2. Smart Skip on Already-Fresh Snapshots (PreloadVisitInspector.php): Before requesting PHP to render a URL, KadiCache checks if a valid, non-expired cache snapshot already exists—skipping redundant renders automatically.
  3. Multilingual & Currency Context Awareness (CurrencyContext.php): Works cleanly alongside WPML, Polylang, TranslatePress, and multi-currency storefronts without polluting canonical guest buckets.
  4. Pause / Resume Anytime: Need zero background traffic during a live database migration? Click Pause Preload in WP Admin -> KadiCache -> Preload (or run wp kadicache preload pause) and click Resume when finished.
BASHManage & Automate Sitemap Warmup via WP-CLI (PreloadCli.php)
# 1. Start a fresh prioritized sitemap discovery & background warmup queue
wp kadicache preload start

# 2. Inspect live queue counts (pending, completed/warmed, failed) in JSON or text
wp kadicache preload status --format=json

# 3. Execute one bounded preload worker cycle synchronously (ideal for system cron!)
wp kadicache preload run --format=json

# 4. Pause or resume an active warmup queue non-destructively
wp kadicache preload pause
wp kadicache preload resume
  • Custom Product & Regional Sitemap Feeds (CustomSitemaps.php): If an enterprise ERP or headless catalog generator publishes supplemental XML sitemaps outside your primary SEO plugin index (for example https://example.com/promotions-sitemap.xml), paste those full HTTPS URLs into Custom Sitemap URLs inside WP Admin -> KadiCache -> Preload—KadiCache validates same-origin ownership and merges them into your warmup cycle automatically.
  • Monitoring Queue Health Over MCP (get_preload_status): Agencies automating releases with Claude Code or KadiCache Pulse can poll get_preload_status (read scope) or trigger manage_preload (operate scope) remotely without SSH—confirming exact warmed, pending, and skipped URL counts across every deployment.

Automating Post-Deployment Warmup in Git & CI/CD Pipelines#

Engineering teams deploying theme updates via GitHub Actions, GitLab CI, Deployer, or Capistrano can wire KadiCache’s non-blocking CLI commands directly into their post-release hook so customers never hit cold caches after a deploy:

  • Zero-Downtime Release Sequence: Run wp kadicache repair (verifying drop-in & early-config.php fingerprints against the newly deployed release), followed by wp kadicache purge --all and wp kadicache preload start.
  • Dedicated Cron Runner Option (wp kadicache preload run): On high-traffic enterprise clusters where web containers disable web-triggered cron (DISABLE_WP_CRON = true), schedule * * * * * wp kadicache preload run --quiet on your dedicated CLI worker node—each invocation runs one bounded, lock-protected batch and exits cleanly.

Frequently Asked Operational Questions

Does KadiCache detect Yoast SEO, Rank Math, and SEOPress sitemaps automatically?
Yes! PreloadDiscovery.php automatically detects WordPress core wp-sitemap.xml as well as sitemap indexes generated by Yoast SEO, Rank Math, SEOPress, and All in One SEO—and lets you add extra custom XML sitemap URLs in WP Admin -> KadiCache -> Preload.
Will running Sitemap Preload slow down my shared hosting server?
No. PreloadWorkerLock.php enforces a strict single-worker lock per site with bounded batch execution and memory/time budgets so background warmup never competes with live checkout or visitor traffic.
What is the difference between Purge All and Purge & Preload in the top bar?
Purge All clears cached snapshots so pages rebuild lazily as visitors request them. Purge & Preload clears cached snapshots and immediately starts prioritized background sitemap warmup so visitors hit warm ~14 ms pages right away.
Does Sitemap Preload request URLs that I excluded in Excluded URL Paths or Gutenberg?
Never. UrlPolicy.php filters discovered sitemap URLs against both global Excluded URL Paths and per-post Never cache this page flags before enqueuing them.
Why did Preload pause or report loopback unavailable on a local Docker container?
Inside Docker containers where the public domain resolves to the host machine rather than the PHP container, PHP loopback curl to https://site.test may fail DNS/port resolution unless extra_hosts maps the domain to the web container. Using wp kadicache preload status --format=json shows the exact transport reason.
Gergis — Lead Systems & Cache Architect
Principal WordPress & Cloud Edge Architect
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

apps/wordpress-plugin/src/Preload/Preloader.phpapps/wordpress-plugin/src/Preload/PreloadDiscovery.phpapps/wordpress-plugin/src/Preload/ContentPriority.phpapps/wordpress-plugin/src/Preload/PreloadCli.php
Was this engineering guide helpful?