Skip to main content
KadiCache
Core & Object CacheFree Core

Smart Preload & Instant Links

Keeps public pages hot automatically using XML sitemap discovery, bounded concurrency, automatic cooldown on slow origins, and a tiny hover/touch Instant Links script capped at 3 prefetches/sec with zero private route leakage.

Perceived Link Navigation
0 ms
Verified Source Entry
apps/wordpress-plugin/src/Preload/Preloader.php
Verified Engine Capabilities

Engineered for zero regressions.

  • Bounded worker batches (up to 100 URLs / 20s budget) with adaptive server-load cooldowns
  • Automatic renewal when cached entries enter the final fifth of their TTL window
  • Instant Links hover/touch prefetch limited to 3/sec on same-origin clean URLs
  • Strict WooCommerce protection rejects speculative misses and private/session paths
Bounded WP-CLI Sitemap Preload & Queue Control
$ wp kadicache preload status --format=json
$ wp kadicache preload start
$ wp kadicache preload run --url=https://example.com
# Executes one bounded worker cycle (<= 100 jobs) with cryptographic loopback proof
Inside the KadiCache WordPress Plugin

Smart Preload & Instant Links — Plugin Interface

2 live 2x Retina plugin screens
WP Admin -> KadiCache -> Preload & Warmup
MODULE 03 · 2X RETINA
Adaptive Sitemap Preload queue with decoded Unicode/Arabic URLs, Speculation Rules Instant Links, and Resource Hints.2880×1840 WebP
100% Source-Code Verified8 min engineering readUpdated 2026-11-23
Executive Summary · 30-Second SpecZero-Regressions Spec
WP Admin Path
WP Admin -> KadiCache -> Preload
Measured Impact
Hot Cache After Purge · <= 3/sec Safe Hover Prefetch
Verification Marker
script#kadicache-instant-links | Sec-Purpose: prefetch
  • Parses WordPress core, Yoast, Rank Math, SEOPress, Multilingual, and custom XML sitemaps into a persistent PreloadJobStore ordered by drag-and-drop ContentPriority.
  • Runs bounded Action Scheduler ticks (MAX_BATCH_JOBS = 100) signed with PreloadProofPolicy tokens 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"> (100ms hover delay, 3/sec throttle) 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:

  1. 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 trigger 502 Bad Gateway errors on shared and mid-tier VPS hosting.
  2. Inter-Page Navigation Latency: Even when every URL on your origin is warm (14 ms server 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:

FIG 01Ordering WooCommerce Products, Pages, and Posts so high-revenue URLs warm first after a purgeZoom 2x
  • 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_enabled or 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 ScenarioNaive Unbounded CrawlerNo Preloader (Lazy Misses)KadiCache Preloader.php
Post-purge Homepage & Top ProductsRandom XML order (often last)Cold 500 ms miss for first shopperWarmed first via ContentPriority
Origin CPU Impact on 2-vCPU VPSSpikes PHP-FPM to 100%Spikes during traffic burstsBounded ticks + PreloadWorkerLock
Pages with DONOTCACHEPAGERetried wastefully every cycleRe-rendered every visitClassified via STABLE_BYPASS_REASONS
Approaching TTL ExpirationExpires cold, then re-crawlsVisitor hits cold rebuildRenewed 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: 100 ms of pointer hover before prefetching (filtering out accidental mouse sweeps across navigation bars), while mobile touch devices trigger on touchstart just before finger lift.
  • Strict rateThrottle: 3 Prefetches/Second: Caps concurrent background prefetches to at most 3 URLs per second and skips prefetching automatically when the visitor's browser reports Save-Data: on or slow 2g cellular connections.
  • CSP-Aware Automatic Fallback (InstantLinks::finalize()): Inspects outbound Content-Security-Policy headers and <meta> tags via CspPolicy. If strict script-src rules block inline scripts without a matching nonce, KadiCache automatically converts #kadicache-instant-links into an external defer script (assets/frontend/js/instant-links.js) instead of triggering browser console CSP violations!

Operators and CI/CD deployment pipelines can trigger, pause, resume, or inspect warmup queues directly through PreloadCli.php:

BASHWP-CLI Preload Queue Inspection & Deployment Warmup
# 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 resume
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/ContentPriority.phpapps/wordpress-plugin/src/Preload/Sitemap/SitemapXmlParser.phpapps/wordpress-plugin/src/Optimization/InstantLinks.phpapps/wordpress-plugin/src/Preload/PreloadCli.php

Technical FAQ

Will enabling Sitemap Preload overload a small 1-vCPU or 2-vCPU VPS?

No. Preloader runs inside cooperative Action Scheduler ticks serialized by PreloadWorkerLock, capped to bounded batches (MAX_BATCH_JOBS = 100), and yields cleanly if ownership or server health guards trip.

Which XML sitemaps does KadiCache discover automatically?

PreloadDiscovery automatically detects native WordPress sitemaps (/wp-sitemap.xml), Yoast SEO, Rank Math, SEOPress, All in One SEO, active multilingual domain sitemaps, plus any custom sitemap URLs you add in WP Admin -> KadiCache -> Preload.

Can Instant Links accidentally trigger ?add-to-cart=, /logout, or affiliate redirect counters?

No. InstantLinks excludes query actions, WooCommerce cart/checkout/account paths, EDD checkout pages, YITH wishlists, wp-login/logout segments, download links, and /out/, /go/, /refer/, and /recommends/ affiliate prefixes automatically.

Why does KadiCache cap browser prefetch cache lifetime to 15 seconds?

A server-side cache purge cannot reach into a visitor’s RAM to delete an already-prefetched response. Capping Sec-Purpose: prefetch Cache-Control to at most 15 seconds (and only on nonce-free HITs) delivers instant hover-to-click navigation without risking stale prices minutes later.

What happens if my site enforces a strict Content-Security-Policy without unsafe-inline?

InstantLinks::finalize() parses your outbound CSP via CspPolicy. When inline scripts are disallowed and lack a matching nonce, KadiCache automatically rewrites #kadicache-instant-links to load external assets/frontend/js/instant-links.js with defer so zero CSP errors occur.

How does Content Priority improve post-purge performance on large WooCommerce catalogs?

Instead of crawling 10,000 blog tags alphabetically, ContentPriority queues your homepage, top pages, and WooCommerce products first so high-converting landing pages are warm seconds after a purge.

Does Instant Links respect mobile data-saver settings?

Yes. The client script checks navigator.connection.saveData and effective connection type, skipping speculative background prefetches when a visitor has Data Saver enabled or is on a constrained 2G connection.