Skip to content

DJIA CacheSet up and verify

Verify HIT, MISS and BYPASS responses

DJIA Cache tells you in two response headers whether a page came from the cache and, when it did not, why. Read them once after installing and whenever a page looks stale or slow.

What this does

Every response the plugin touches carries X-Djia-Cache: HIT when the advanced-cache.php drop-in served a stored file before WordPress loaded, MISS when WordPress rendered the page and the plugin stored it on the way out, BYPASS when the page was rendered but deliberately not stored. A request the drop-in skipped also gets X-Djia-Dropin: skip:reason, so a page that is never a HIT explains itself. There is no hit-and-miss statistic in the admin; the headers are the source of truth, together with the Cached Pages tab, which lists every stored URL.

Steps

  1. Confirm the page cache is on.

    Open Settings → DJIA Cache, tab Cache: "Enable page caching for anonymous visitors" is on by default. Save the settings once if you changed anything: saving also rewrites the drop-in's config file.

  2. Request a public page twice as an anonymous visitor.

    Use a private window (no login cookie) or curl. With curl, send a GET, not curl -I: a HEAD request is looked up like GET only when a DJIA Builder runtime is registered; otherwise the drop-in skips it silently.

    terminal
    # first request after a purge: MISS, written to the cache folder
    curl -s -o /dev/null -D - https://example.com/ | grep -i x-djia
    # same request again: HIT from the drop-in
    curl -s -o /dev/null -D - https://example.com/ | grep -i x-djia

    In a browser, open the developer tools, the Network panel, reload, click the document request and read its response headers.

  3. Read the first answer.

    The first request after a purge is a MISS: WordPress rendered the page and the plugin wrote it to the cache folder. The drop-in explains why it did not serve: X-Djia-Dropin: skip:no_cache_file.

  4. Read the second answer.

    The second request is a HIT from the drop-in, with no X-Djia-Dropin header. With Fast Path enabled on Apache or LiteSpeed the web server answers without PHP and the value is HIT-fastpath (the same on Nginx with the snippet in place).

  5. Check the list of cached pages.

    Tab Cached Pages lists every stored URL, newest first, with a search box. Your page should be there now. Over WP-CLI, wp djia-cache status prints page_cache on, the TTL and the number and size of cache files.

  6. Test a page that must never be cached.

    Request /cart/ or /checkout/. They are in the default bypass paths, so the drop-in answers with X-Djia-Dropin: skip:bypass_path and the plugin sends no X-Djia-Cache at all: the request is not cacheable, so nothing was looked up or stored.

What you should see

  • X-Djia-Cache: HITserved by the drop-in before WordPress loaded (PHP ran, WordPress did not)
  • X-Djia-Cache: HIT-fastpathserved by the web server from the Fast Path mirror; no PHP
  • X-Djia-Cache: HIT-phpserved from the cache, but by the plugin inside WordPress: the drop-in did not serve. Look at X-Djia-Dropin for the cause (usually config_missing or config_invalid)
  • X-Djia-Cache: MISSrendered by WordPress and stored now; the next anonymous request is a HIT
  • X-Djia-Cache: REFRESHa background refresh request re-rendered the page in place; visitors kept getting the old copy meanwhile
  • X-Djia-Cache: BYPASSrendered, not stored; X-Djia-Cache-Reason names the rule
  • no X-Djia-Cache headerthe request was not cacheable (logged in, bypass path, query key or cookie, a 404, a redirect, a WooCommerce cart, checkout or account page). X-Djia-Dropin says which rule

Why a page was not served from the cache

The X-Djia-Dropin: skip:… reasons you will meet most often:

Drop-in skip reasons
ReasonMeaning
no_cache_fileNothing stored for this URL yet (first visit, or after a purge).
ttl_expiredThe stored file is older than its TTL; WordPress renders a fresh copy.
logged_inA wordpress_logged_in_ cookie is present and caching for logged-in users is off (the default).
bypass_path, bypass_query, bypass_cookieThe URL, a query key or a cookie matches an exclusion (defaults include /cart/, /checkout/, /my-account/, /wp-json/, add-to-cart, wc-ajax, preview).
disabledThe page cache switch is off.
builder_editorA DJIA Builder editor or preview request; never cached.
no_cache_headerThe request carried X-Djia-No-Cache: 1 (the Builder self-test and DJIA Filter use it).
config_missing, config_invalidThe drop-in could not read its config file. Save the settings once to rewrite it; if it persists, use the "Resolve conflicts" guide.

X-Djia-Cache: BYPASS has its own reasons in X-Djia-Cache-Reason: nocache_section (the page contains a djia-nocache section or a DJIA_NOCACHE marker), incomplete_html (the HTML has no <html>, </body> or </html>, usually a plugin that cut the output), html_too_short (under 255 bytes) and force_reload_cookie (the optional "force reload on click" setting).

With DJIA Builder

On a page the DJIA Builder runtime renders, the first anonymous answer carries both headers: X-Djia-Runtime: MISS from the runtime and X-Djia-Cache: MISS from the cache that stored it (with the "Hand misses to the DJIA Builder runtime" and "Runtime writes" switches on). The second answer is a plain X-Djia-Cache: HIT from the drop-in; the runtime did not run. When the runtime answered but the cache refused to store (a logged-in visitor, a non-200 status, a Set-Cookie or a private Cache-Control), you get X-Djia-Cache: BYPASS with the refusal in X-Djia-Cache-Reason. The DJIA Builder tab of the cache settings keeps the last 50 requests the drop-in did not serve, with their reasons and the runtime time.

Limits

  • A HIT still executes PHP: the drop-in is a PHP file WordPress loads first. Only Fast Path (HIT-fastpath) answers without PHP, and it is off by default.
  • Fast Path never serves logged-in visitors, non-default languages, URLs with a query string or the mobile variant, and it does not check the TTL; those requests fall through to the drop-in.
  • A shopper with a WooCommerce cart cookie is still served HITs of ordinary pages, but pages rendered for that shopper are not stored (no header is sent for them).
  • The plugin counts files and sizes; it does not keep hit and miss statistics.

If it doesn't work

  • Every request is MISS, never HIT. Check the Cached Pages tab: if the URL appears and disappears, a purge rule or a scheduled preload clears it ("Clear entire cache when settings are saved", purge on post save, a short TTL). If it never appears, the cache folder is not writable.
  • HIT-php instead of HIT. The drop-in is not serving: read X-Djia-Dropin. config_missing or config_invalid means the drop-in config file is gone or stale; saving the settings rewrites it. No X-Djia-Dropin at all and no HIT means another plugin's advanced-cache.php is loaded, or WP_CACHE is off in wp-config.php.
  • No X-Djia-* header anywhere. The plugin is inactive, the page cache switch is off, or a CDN or hosting cache in front strips unknown headers; test against the origin server directly.
  • You are testing while logged in. That is skip:logged_in by design; use a private window or curl.

Last verified 2026-10-19 · tested with DJIA Cache 1.3.0.12, DJIA Builder 1.0.18.5
To confirm Verified against the plugin code; run the requests on a test site before launch