Skip to content

Why WordPress Chat Plugins Break Page Caches (And How HMAC Sessions Fix It)

Many WordPress chat plugins render wp_create_nonce('wp_rest') into inline HTML during page generation. When a page cache like WP Fastest Cache, Varnish, or Cloudflare serves that HTML for days, visitors eventually send expired nonces and hit HTTP 403 errors.

How BridgeChat AI Solves It

  1. In public widget mode, BridgeChat_AI_Frontend omits wpNonce from cached page HTML entirely.
  2. When the visitor opens the chat panel, POST /wp-json/bridgechat-ai/v1/session issues a random UUID paired with an HMAC-SHA256 signature computed from a site-unique secret stored in bridgechat_ai_secrets.
  3. Every chat, handoff, and polling endpoint sets Cache-Control: no-store, no-cache, must-revalidate, max-age=0 and verifies the session token with hash_equals().

The result: static HTML stays fast at the edge while live chat sessions remain authenticated and isolated per visitor. Learn more in our architecture overview and security documentation.