Skip to content

Conversation

@solankisoftware89
Copy link

Trac Ticket: https://core.trac.wordpress.org/ticket/64366

This PR enhances the WordPress Site Health page cache test by introducing
a robust cache header detection mechanism. The previous method could
produce false positives or negatives depending on the caching system used.

Changes include:

  • Added detect_cache_headers() method for strict, case-insensitive header matching
  • Improved support for common cache headers (x-cache, x-cache-status, cf-cache-status, x-litespeed-cache, x-varnish, etc.)
  • Updated get_test_page_cache() to use detect_cache_headers()
  • Prevents false positives when unrelated text contains words like "HIT" or "MISS"

Testing:

  1. Enable any caching layer (Varnish, NGINX fastcgi_cache, Cloudflare, LiteSpeed, host-level caching)
  2. Go to Tools → Site Health → Status
  3. Verify that page cache detection reflects the real server cache status

This PR is backward compatible and does not change existing Site Health UI behavior.

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props solankisoftware.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant