Skip to main content
KadiCache
Browse 37 Docs Guides & Search

Self-Healing Delay JS: Automatic Real-Browser Visual Locks (Pro)

Enable automatic real-browser CSS geometry locks for delayed carousels, entrance animations, preloaders, and collapsed slots across Desktop & Mobile in WP Admin, KadiCache Pulse, and AI MCP.

apps/wordpress-plugin-pro/src/Local/LocalSettings.phpapps/wordpress-plugin-pro/src/Local/BrowserHintsRewriter.phpapps/wordpress-plugin-pro/src/Local/BrowserHintsEndpoint.phpapps/wordpress-plugin-pro/assets/local-vitals-beacon.jsapps/wordpress-plugin-pro/views/delay-locks.php
WP Admin -> KadiCache -> CSS & JavaScript -> Self-Healing Delay JS
MODULE 17 · 2X RETINA
Self-Healing Delay JS tracks real-browser learned Desktop & Mobile viewports, shared templates, Watchdog CLS health, and 1-click template learning.2880×1840 WebP
Quick Summary · 30-Second Operational SpecSource-Verified Guide
WP Admin Path
WP Admin -> KadiCache -> CSS & JavaScript -> Self-Healing Delay JS
Expected Outcome
0ms Pre-Delay Visual Stability · Desktop + Mobile · 0 Cloud Quota
Key Marker / Engine
kadicache-local-delay-css | kadicache_pro_local_delay_locks
  • Toggle Self-Healing Delay JS ON in WP Admin -> KadiCache -> CSS & JavaScript (or inside KadiCache Pulse under CSS & JavaScript) on any connected KadiCache Pro site.
  • Learns real pre- vs post-Delay geometry in real visitor browsers via HMAC-signed POST /wp-json/kadicache-pro/v1/browser-hints without consuming Cloud Pro worker quota.
  • Applies 4 universal pure-CSS geometric locks (carousel, reveal, hide, height) scoped to Desktop (>=768px) and Mobile (<=767px), patching cached HTML in place with 0 cache purges.
  • Auto-releases locks via delay.js tier-2 handoff once delayed scripts initialize, and resets on theme switch, post edit, or 1-click Reset learned data.

Enabling Self-Healing Delay JS in WP Admin, Pulse & AI MCP#

Self-Healing Delay JS (kadicache_pro_local_delay_locks) is a KadiCache Pro feature powered 100% locally by real visitor browsers. Follow these three steps to enable it:

  1. Connect KadiCache Pro: Ensure KadiCache Pro is installed and paired under WP Admin -> KadiCache -> Cloud Connection (paid Pro seat or 7-Day Free Trial).
  2. Select Delay Until Interaction: Open WP Admin -> KadiCache -> CSS & JavaScript and set JavaScript Loading Strategy to Delay Until Interaction (delay_js_enabled).
  3. Toggle Self-Healing Delay JS ON: In the same JavaScript Execution & Minification card, switch Self-Healing Delay JS ON and click Save Changes.
FIG 01Self-Healing Delay JS tracks real-browser learned Desktop & Mobile viewports, shared templates, Watchdog CLS health, and 1-click template learning.Zoom 2x

You can also govern the exact same toggle remotely from KadiCache Pulse -> CSS & JavaScript -> Self-Healing Delay JS (pro_delay_locks_enabled), or via AI MCP:

JSONAI MCP Tool Call (manage_pro_cloud)
{
  "action": "configure",
  "toggles": { "delay_locks": true }
}
FIG 02Inspect active pure-CSS geometric locks per scope (Global, Template, and Page) with Watchdog Verified badges and 1-click Re-learn or Reset.Zoom 2x

How Real-Browser Self-Healing Works (2-Visit Lifecycle)#

PhaseWhat Happens Inside WordPress & the BrowserNetwork / Cache Overhead
Visit #1 (Learning Visit)On an unlearned page with delayed scripts (data-kadicache-delay), BrowserHintsRewriter.php stamps deterministic data-kc-b container markers and loads local-vitals-beacon.js. When a real visitor interacts (tap, scroll, mousemove), the beacon diffs pre-Delay vs post-Delay geometry and posts a signed HMAC payload to /wp-json/kadicache-pro/v1/browser-hints.1 tiny same-origin JSON beacon per viewport (bots, HeadlessChrome & Lighthouse ignored)
In-Place Cache PatchBrowserHintsEndpoint.php validates the HMAC signature, saves sanitized locks into wp_kadicache_pro_browser_hints (delay_json), and patches the existing disk cache HTML in place via kadicache_patch_cached_html.0 cache purges (instant update)
Visit #2+ (Healed Delivery)BrowserHintsRewriter.php removes local-vitals-beacon.js completely and injects <style id="kadicache-local-delay-css" data-kadicache-layout-tier="2"> scoped per @media (min-width:768px) and @media (max-width:767px). Once delayed scripts initialize on interaction, delay.js removes the lock stylesheet cleanly.0 bytes JS · Pure CSS at 0 ms

What Self-Healing Delay JS Fixes Automatically vs Honest Limits#

Automatically fixed across themes & builders (pure geometry, zero class hardcoding):

  • Multi-column & single-slide carousels (Slick, Swiper, Owl Carousel, Splide, Flickity, WooCommerce product carousels, Elementor/WPBakery sliders) — renders exact Desktop and Mobile column counts at 0 ms and hides overflow slides while preventing ::before/::after clearfix grid column theft.
  • Invisible entrance animations (opacity: 0, visibility: hidden, slide-up/zoom transform from AOS, GSAP, Salient, Elementor) — reveals hero headings and above-the-fold cards immediately at 0 ms.
  • Stuck loading spinners & page preloaders — hides temporary JS preloaders while protecting off-screen mobile drawers and hover mega-menus.
  • Collapsed 0px widget/ad slots — reserves exact measured post-JS min-height to prevent vertical CLS shifts.

When to pair with another KadiCache control:

  • Hero images using JS data-src lazy-loading: Enable Pro Local Improve LCP so the real above-the-fold hero image is de-lazied and preloaded directly in HTML.
  • Scripts that must run at 0 ms without waiting for interaction (e.g., live calculators, instant chat triggers, or JS-only remote embeds): Add the script handle or inline keyword to Delay JavaScript Exclusions (delay_js_exclusions) or exclude specific paths via delay_js_excluded_paths.

Frequently Asked Operational Questions

Why does Self-Healing Delay JS show as locked in KadiCache Pulse on my Free site?
Self-Healing Delay JS is part of KadiCache Pro, so KadiCache Pulse enforces the exact same Pro entitlement gate as Remove Unused CSS, Improve LCP, Layout Stability, and Lazy Render. Activate a Cloud Pro plan or 7-Day Free Trial on the site to unlock the toggle immediately.
Why did my first test visit in PageSpeed Insights or Playwright not generate lock CSS?
BrowserHintsEndpoint.php intentionally rejects Lighthouse, PageSpeed Insights, HeadlessChrome, and automated crawlers so bots can never poison your learned layout geometry. Visit the page once in a normal desktop/mobile browser and interact once so real-browser locks are recorded.
Does clearing KadiCache page cache wipe my learned Self-Healing Delay JS locks?
No. Learned rows in wp_kadicache_pro_browser_hints survive all page cache clears so you never lose 0ms visual fidelity after clearing cache. Locks reset only on theme switch, post content edits, or clicking Reset learned data.
Does Self-Healing Delay JS obey Delay JavaScript Excluded Paths?
Yes. LocalSettings::delayLockAllowed() checks delay_js_excluded_paths (and site excluded_paths) automatically, so any page excluded from Delay JS also skips Self-Healing Delay JS.
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-pro/src/Local/LocalSettings.phpapps/wordpress-plugin-pro/src/Local/BrowserHintsRewriter.phpapps/wordpress-plugin-pro/src/Local/BrowserHintsEndpoint.phpapps/wordpress-plugin-pro/assets/local-vitals-beacon.jsapps/wordpress-plugin-pro/views/delay-locks.php
Was this engineering guide helpful?