# Find out why WordPress pages are not cached with Kiro

> Finding out why pages are not cached with Kiro means asking its agent to read xSpeed health checks and a benchmark through xSpeed Hub, then explaining why a page is served through PHP instead of as a static file.

Page: https://xspeedcache.com/agent/kiro/troubleshoot-cache/
Last updated: October 2026

You expected the fastest cache path and the response time says otherwise: about 85 ms, not a handful. You are in Kiro with the site's code open, and you ask: pages on shop hit the cache but feel slower than they should, why? It reads get_cache_status first, to confirm that caching is on and the hit ratio is healthy.

Then it reads get_health and runs run_benchmark. Caching works, and the benchmark's cached request is a hit. The health report says hits are served through PHP because the pages contain nonces. A statically served file runs no PHP, so it could never refresh a nonce, and xSpeed serves those pages through PHP on purpose. The answer is that nothing is broken and no server snippet will change it. Without nonces, a static route would be a server configuration step.

Kiro prompts before it runs an MCP tool unless the tool is on the server's autoApprove list or a permission rule allows it. That makes it easy to approve exactly the read tools this job needs and nothing else. Ask Kiro to say what would have to change for a static file to be served, and what that would cost. It turns a vague worry about speed into a decision: keep the nonce pages as they are, or change them. The first needs no work, and the second is a change to your site that you would make yourself, outside xSpeed.

## Set up Kiro once

### 1. Put your sites in xSpeed Hub

Sign in at app.xspeedcache.com with Google or email; the Hub is free and has no site cap. Then connect each WordPress site from its own dashboard: click Connect Hub in the xSpeed Cache top bar, then Connect via xSpeed Hub. Each site needs the free xSpeed Cache plugin.

### 2. Add xSpeed Hub to mcp.json

Open the command palette and run Kiro: Open user MCP config (JSON), then add this entry. The user file applies in every workspace. A project can carry its own .kiro/settings/mcp.json instead, but Kiro does not load a workspace's MCP config until you trust that workspace. Kiro reconnects servers when you save the file.

File: `~/.kiro/settings/mcp.json`

```json
{
  "mcpServers": {
    "xspeedhub": {
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}
```

### 3. Approve access in the browser

After you save, Kiro opens the xSpeed Hub authorization page. It registers itself through dynamic client registration, so there is no client ID to create. Sign in to the Hub, approve, and check the MCP servers tab in the Kiro panel for a connected xspeedhub. There is no token to paste; Kiro keeps the credentials it receives.

Full setup: https://xspeedcache.com/agent/kiro/

### Before you send a prompt that changes something

Reads change nothing on your sites, though contact_support emails xSpeed support. Writes run once your connection allows them, so your client's approval prompt and a read-only connection (the token's Read-only everywhere switch, or a Viewer sign-in) are the gates that matter. Kiro prompts before it runs an MCP tool unless a rule allows it. Rules live in two places: autoApprove in the server's mcp.json entry, which lists tool names, and mcp rules in permissions.yaml, such as a match of xspeedhub/get_* with effect allow. Allow the reads and keep purge_cache, update_settings, toggle_cache and the other write tools off both lists, because the Hub itself runs a write as soon as your connection allows it. Putting "*" in autoApprove skips the prompt for every Hub tool, writes included. In a workspace you have not trusted, Kiro asks before every MCP call even when autoApprove lists the tool.

## Prompts

- Cached pages on shop take about 85 ms. Check the xSpeed Hub health report and tell me why they are not served faster.
- Using xSpeed Hub, is the nginx static rewrite active on shop? Read the health checks and tell me.
- Ask xSpeed Hub for a benchmark on shop and explain whether the cached request was a hit.

## Example session

```
You: Shop pages hit the cache but take about 85 ms. Using xSpeed Hub, why not faster?
  → get_cache_status(site: shop) [read-only]: page cache on, 97 cached pages, hit ratio 83% in the last 24h
  → get_health(site: shop) [read-only]: serving cache hits through PHP because pages contain nonces; other checks pass
  → run_benchmark(site: shop) [read-only]: home page: 520 ms uncached, 86 ms cached, cached request was a hit
Agent: Nothing is broken. A file served statically runs no PHP and could never refresh a nonce, so xSpeed serves these pages through PHP on purpose. The cache works; this is the cost of nonces on those pages.
```

## How it works

1. **Start with the quick summary**: get_cache_status returns whether page caching is on, the stats (cached pages, size, hit ratio, last purge) and the web server xSpeed detected. It is a glance. If caching is off, or the hit ratio is far below what you expect, the agent moves on to the diagnostic.
2. **Run the diagnostic**: get_health is the tool for troubleshooting. It returns the environment checks with pass or warn tones (the advanced-cache.php drop-in, the WP_CACHE constant, rewrite rules, PHP and WordPress versions, caching plugin conflicts), the cache stats, 24 hourly hit and miss buckets and a 30-day hit-ratio series. The Hub tells the agent to use it, not get_cache_status, when you are troubleshooting rather than glancing.
3. **Time cached against uncached**: run_benchmark requests the home page once with the cache bypassed and once normally, after a warm-up request, and returns the timings. If the second request still is not a cache hit, the page cache is not serving the home page, and the result says so. It measures xSpeed's own response time. It does not return a Lighthouse score.
4. **Read what the checks mean**: A warn is a lead, not always a fault. A static-file rewrite warning, for example, can mean the nginx snippet is not in your server config yet, or that xSpeed could not verify it, which is not evidence the config is wrong. The agent reads the detail line and tells you which one it is.
5. **Fix it or hand it over**: If caching is simply off, toggle_cache turns it on. If another caching plugin owns the drop-in, the site refuses to enable xSpeed and says why; removing the other plugin is yours to do. If nothing explains it, contact_support emails xSpeed support with the agent's summary, after the agent has confirmed the message with you.

## Reference

| | |
| --- | --- |
| Quick check | get_cache_status (read): cache on or off, stats, detected web server |
| Diagnostic | get_health (read): environment checks, 24 hourly buckets, 30-day hit-ratio series, recent activity |
| One site per call | get_health does not accept site: "all"; call it for each site you care about |
| Benchmark | run_benchmark (read): home page only, cache bypassed against cache served, timings in milliseconds |
| Benchmark on every site | run_benchmark accepts site: "all" or a list of handles, one result per site |
| Benchmark history | get_benchmark_history reads past runs and the settings changes on the same timeline |
| Pro suggestions | get_pro_audit (read): which Pro features would help this site, from its settings and stats |
| Hit ratio scope | Counts requests that reach your server; pages answered by a CDN or Cloudflare edge are not counted |
| Support | contact_support emails xSpeed support with your account email and site list attached; classed read |
| Turning caching on | toggle_cache (write); refused by the site when another plugin owns the cache drop-in |

## Rules

- Diagnose with the read tools first. get_cache_status, get_health, run_benchmark and get_pro_audit change nothing on the site, so a read-only connection can run all of them. For clients that send the connection token, that means Read-only everywhere on; an OAuth sign-in gets the scopes the client asks for, unless the member is a Viewer.
- Do not answer a PageSpeed question with run_benchmark. It measures cached against uncached response time and returns no Lighthouse score; for a score, use the speed test or scan jobs.
- toggle_cache is a write. It runs as soon as your connection allows writes, and the Hub tells the agent to confirm the target site first. That is guidance to the agent, so your client's approval prompt is the gate that matters.
- contact_support sends a real email. The Hub tells the agent to confirm the message with you before sending, but the tool is classed read, so even a read-only connection can send one.
- The agent cannot edit your server configuration or another plugin's settings. When a check needs an nginx snippet or a conflicting plugin removed, it tells you what to do and you do it.

## Good to know with Kiro

If you add tools to autoApprove, add get_cache_status, get_health, run_benchmark and get_pro_audit by name and stop there. Leave contact_support and the write tools off the list. The Hub has no confirmation step of its own: a write runs as soon as your connection allows it, and its request that the agent confirm first is guidance to the model. An entry in autoApprove removes the one prompt you would otherwise have seen, and an asterisk there skips the prompt for every Hub tool, writes included. In a workspace you have not trusted, Kiro asks before every MCP call even when autoApprove lists the tool. For a report-only setup, list the write tools and contact_support in disabledTools so Kiro never offers them to the agent.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Using xSpeed Hub, why is the cache hit ratio so low on shop? Run the full health check and tell me the most likely cause.
- Using xSpeed Hub, is page caching actually working on blog? Benchmark cached against uncached and tell me if the second request was a hit.
- xSpeed Hub's get_health on docs shows a warning about the static-file rewrite. What does it mean and do I need to act?
- Use xSpeed Hub to check whether another caching plugin is conflicting with xSpeed on shop.
- Caching looks off on the staging site. Use xSpeed Hub to turn it on and tell me if the site refuses.
- Using xSpeed Hub, which Pro features would help the shop site, based on how it is set up now?
- With xSpeed Hub, compare the last few benchmark runs on blog and tell me whether my settings changes helped.

## Frequently asked questions

### Why are my cached pages served through PHP in Kiro's report?

Hits are served through PHP when the pages contain nonces, because a statically served file runs no PHP and could not refresh them. xSpeed does this on purpose, and the benchmark still shows the cached request as a hit.

### Which xSpeed tools should I put on Kiro's autoApprove list?

For troubleshooting, only the read tools: get_cache_status, get_health, run_benchmark and get_pro_audit. Leave write tools and contact_support off, so Kiro keeps prompting for anything that changes the site or sends mail.

### Why are my WordPress pages not being cached?

The common causes are that page caching is switched off, the advanced-cache.php drop-in or the WP_CACHE constant in wp-config.php is missing, another caching plugin owns the drop-in, or the pages set cookies or headers that make them uncacheable. An agent can read all of these from get_health through xSpeed Hub and tell you which one applies to your site.

### What is the difference between get_cache_status and get_health?

get_cache_status is a quick summary: whether caching is on, the stats and the detected web server. get_health is the diagnostic. It adds the environment checks with pass or warn tones, 24 hourly hit and miss buckets and a 30-day hit-ratio series. The Hub tells the agent to use get_health when you are troubleshooting.

### Does run_benchmark give me a PageSpeed score?

No. run_benchmark measures how fast your own cache answers compared with an uncached request for the home page. For a Lighthouse score, ask for a speed test or a speed scan instead.

### Can the agent check every site at once?

Only partly. run_benchmark accepts every site in one call. get_cache_status and get_health take one site per call, and get_health does not accept site: "all", so for a fleet the agent calls them site by site or you use the Hub dashboard for the rollup.

### Will troubleshooting change anything on my site?

Not with the diagnostic tools. They are read tools and change nothing. Changes only happen if the agent calls a write tool such as toggle_cache, which runs once your connection allows writes, so your AI client's approval prompt and a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) are the gates.

## Find out why pages are not cached with other agents

[Claude Code](https://xspeedcache.com/agent/claude-code/troubleshoot-cache/) · [Claude](https://xspeedcache.com/agent/claude/troubleshoot-cache/) · [Claude Cowork](https://xspeedcache.com/agent/claude-cowork/troubleshoot-cache/) · [ChatGPT](https://xspeedcache.com/agent/chatgpt/troubleshoot-cache/) · [Codex](https://xspeedcache.com/agent/codex/troubleshoot-cache/) · [Cursor](https://xspeedcache.com/agent/cursor/troubleshoot-cache/) · [GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/troubleshoot-cache/) · [Windsurf](https://xspeedcache.com/agent/windsurf/troubleshoot-cache/) · [Gemini CLI](https://xspeedcache.com/agent/gemini-cli/troubleshoot-cache/) · [Antigravity](https://xspeedcache.com/agent/antigravity/troubleshoot-cache/) · [Zed](https://xspeedcache.com/agent/zed/troubleshoot-cache/) · [OpenCode](https://xspeedcache.com/agent/opencode/troubleshoot-cache/) · [OpenClaw](https://xspeedcache.com/agent/openclaw/troubleshoot-cache/) · [Hermes Agent](https://xspeedcache.com/agent/hermes-agent/troubleshoot-cache/) · [Grok Build](https://xspeedcache.com/agent/grok-build/troubleshoot-cache/) · [ChatGPT dots](https://xspeedcache.com/agent/chatgpt-dots/troubleshoot-cache/) · [Grok](https://xspeedcache.com/agent/grok/troubleshoot-cache/) · [Grok Bot](https://xspeedcache.com/agent/grok-bot/troubleshoot-cache/) · [Muse](https://xspeedcache.com/agent/muse/troubleshoot-cache/) · [Manus](https://xspeedcache.com/agent/manus/troubleshoot-cache/) · [Kimi Code](https://xspeedcache.com/agent/kimi/troubleshoot-cache/) · [Paperclip](https://xspeedcache.com/agent/paperclip/troubleshoot-cache/) · [NanoClaw](https://xspeedcache.com/agent/nanoclaw/troubleshoot-cache/)

## More with Kiro

- [Purge the WordPress cache with Kiro](https://xspeedcache.com/agent/kiro/purge-cache/)
- [Scan a website for speed problems with Kiro](https://xspeedcache.com/agent/kiro/speed-scan/)
- [Run and track PageSpeed tests with Kiro](https://xspeedcache.com/agent/kiro/pagespeed-tests/)
- [Raise a WordPress site's PageSpeed score with Kiro](https://xspeedcache.com/agent/kiro/optimize-site/)
- [Tune WordPress cache settings with Kiro](https://xspeedcache.com/agent/kiro/cache-settings/)
- [Warm the WordPress cache with Kiro](https://xspeedcache.com/agent/kiro/preload-cache/)
- [Set up the Redis object cache with Kiro](https://xspeedcache.com/agent/kiro/object-cache/)
- [Manage Cloudflare caching with Kiro](https://xspeedcache.com/agent/kiro/cloudflare/)
- [Manage every WordPress site at once with Kiro](https://xspeedcache.com/agent/kiro/fleet/)

## Documentation

- How to read your cache diagnostics: https://xspeedcache.com/docs/cache-diagnostics/
- Understanding cache hits and misses: https://xspeedcache.com/docs/hits-and-misses/
- How to check your site health: https://xspeedcache.com/docs/health/
- Common problems and troubleshooting: https://xspeedcache.com/docs/common-problems-and-troubleshooting/
- How to enable Page Cache: https://xspeedcache.com/docs/page-cache/
