xSpeed Cache is officially live! Get 50% OFF during Launch Week — Lifetime starts at just $79Lifetime from $79 — 50% OFF, Launch Week! See Plans →

See Plans →
Features
xSpeed Hub Pricing Docs Blog Scan
Appearance
Get Plugin

Find out why WordPress pages are not cached with Kimi Code

Finding out why pages are not cached with Kimi Code means asking Moonshot AI's terminal agent to read xSpeed health checks and a benchmark through xSpeed Hub, then match a warning to the files your deploy ships.

list_sitesget_cache_statusget_healthrun_benchmarkget_benchmark_historyget_pro_audittoggle_cachecontact_support

Last updated: October 2026

Example session · Kimi Code

You: Since the last release, cached pages on shop take about 90 ms. Use xSpeed Hub to find out why.

get_cache_status(site: shop) read-only
→ page cache on, 188 cached pages, hit ratio 76% in the last 24h, web server Apache

get_health(site: shop) read-only
→ 1 warning: static-file rewrite rules not found; cache hits are served through PHP

run_benchmark(site: shop) read-only
→ home page: 540 ms uncached, 91 ms cached, cached request was a hit

Kimi Code: Caching works, but Apache hands every hit to PHP because the static-file rewrite rules are gone. The .htaccess in this repository has no xSpeed block, so each deploy replaces it. Copy the Apache rules from xSpeed's Health panel into the .htaccess you ship, redeploy, and I will read the health report again.

You: Added the rules and redeployed.

get_health(site: shop) read-only
→ all environment checks pass

run_benchmark(site: shop) read-only
→ home page: 536 ms uncached, 34 ms cached, cached request was a hit

Kimi Code: Fixed. Apache serves hits as static files again, at about a third of the old time.

01

How Kimi Code handles this

Your site runs on Apache, and since last week's release cached pages answer in about 90 ms when they used to take a third of that. You are in the repository with Kimi Code, so you ask there: use xSpeed Hub to find out why cached pages on shop got slower. Kimi Code reads get_cache_status, get_health and run_benchmark, each shown in the session as mcp__xspeedhub__ followed by the tool name.

The benchmark says the cache works: the cached request is a hit. get_health says how it is served. The static-file rewrite rules are missing, so Apache hands every hit to xSpeed's drop-in in PHP instead of serving the saved file itself through .htaccess. Kimi Code can see the other half of the story, because it has your repository open: the .htaccess your deploy ships has no xSpeed block in it, so each release replaced the rules on the server. The fix belongs in the repository, not in xSpeed. Copy the Apache rules from the Server config snippet in xSpeed's Health panel into the .htaccess you deploy, redeploy, and ask Kimi Code to read get_health again.

Kimi Code runs shell commands, so it can check the result from the outside too. Ask it to request the home page twice with a plain GET and read the X-XSpeed-Cache header, which says HIT (static) when Apache serves the file and HIT (php) when the drop-in does. A HEAD request, which is what curl -I sends, reports BYPASS on a healthy site, so it proves nothing here.

02

Set up Kimi Code once

Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Kimi Code guide.

1Put 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.

2Add xSpeed Hub to mcp.json

Put this in ~/.kimi-code/mcp.json to use the Hub in every project, or in .kimi-code/mcp.json inside one repository, where it overrides a user entry of the same name. You can also run /mcp-config and let Kimi Code add it. A server added while a session is open joins only the next session.

~/.kimi-code/mcp.json
{
  "mcpServers": {
    "xspeedhub": {
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}

3Sign in with /mcp-config login

Start a new session with kimi, run this and approve access on the xSpeed Hub page that opens in your browser. There is no token to paste. Then run /mcp to check that xspeedhub is connected.

Text
/mcp-config login xspeedhub
/mcp
1 / 3

Full Kimi Code setup, sign-in options and FAQ

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. In Kimi Code's default Always Ask mode, an MCP call that matches no permission rule asks for approval, and Approve for this session allows the same kind of call until the session ends. Permanent rules go in [[permission.rules]] in config.toml: allow mcp__xspeedhub__get_* and mcp__xspeedhub__list_* to let the reads run, and leave the write tools on the prompt. Ask When Needed mode, from /yolo, approves MCP calls automatically, and Never Ask, from /auto, approves everything. xSpeed Hub has no confirmation step of its own, so in either of those modes a purge or a settings change runs as soon as your connection allows writes. To remove writes altogether, list the read tools in the entry's enabledTools, or use a connection token with Read-only everywhere on.

03

What do I ask?

Three prompts written for Kimi Code. More for this job are below.

Prompt for Kimi Code
Cached pages on shop got slower after the release. Use xSpeed Hub to read the health report and compare it with the .htaccess in this repository.
Prompt for Kimi Code
With xSpeed Hub, run the benchmark on shop, then request the home page twice with a plain GET and show me the X-XSpeed-Cache header each time.
Prompt for Kimi Code
Using xSpeed Hub, read get_health on shop again and confirm the rewrite warning is gone.
04

What happens, step by step

When a WordPress page is not served from cache, the cause is usually one of a few things: caching is off, the cache drop-in or the WP_CACHE constant is missing, another caching plugin is in the way, or the pages carry something that makes them uncacheable. Through xSpeed Hub an agent can read the cache status, run the site's full health diagnostics, time a cached request against an uncached one, and check which Pro features would help, all without changing anything.

01

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.

02

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.

03

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.

04

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.

05

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.

05

Reference

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

Rules worth keeping

  • 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 Kimi Code

In the default Always Ask mode, each Hub call that matches no permission rule asks, and Approve for this session lets that kind of call through until the session ends. A troubleshooting session is mostly reads, so add [[permission.rules]] entries in config.toml that allow mcp__xspeedhub__get_* and mcp__xspeedhub__list_*. run_benchmark and contact_support do not match those patterns and keep asking, which is right for contact_support: it emails xSpeed support, the Hub classes it as a read, and the Hub's request that the agent confirm the message is guidance only. Avoid /yolo and /auto for this work. Ask When Needed approves MCP calls automatically and Never Ask approves everything, and xSpeed Hub has no confirmation step of its own. A server added while Kimi Code is open joins only the next session.

07

More prompts for this job

They work in any client connected to xSpeed Hub.

Prompt
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.
Prompt
Using xSpeed Hub, is page caching actually working on blog? Benchmark cached against uncached and tell me if the second request was a hit.
Prompt
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?
Prompt
Use xSpeed Hub to check whether another caching plugin is conflicting with xSpeed on shop.
Prompt
Caching looks off on the staging site. Use xSpeed Hub to turn it on and tell me if the site refuses.
Prompt
Using xSpeed Hub, which Pro features would help the shop site, based on how it is set up now?
Prompt
With xSpeed Hub, compare the last few benchmark runs on blog and tell me whether my settings changes helped.
08

Frequently asked questions

Often, yes. xSpeed Hub tells it which check fails, such as missing static-file rewrite rules, and Kimi Code can then read the files your deploy ships, such as .htaccess, to see whether a release replaced them. A cause that lives only on the server stays a finding for you.

Allow rules in config.toml whose patterns match the Hub's get_ and list_ tools, which Kimi Code names mcp__xspeedhub__ followed by the tool name, let the main reads run without a prompt. run_benchmark still asks, and so do contact_support and the write tools, which is what you want for anything that changes the site or sends an email.

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.

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.

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.

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.

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.

09

Keep going

Find out why pages are not cached with other agents

More with Kimi Code

Documentation

From the blog

Find out why pages are not cached, from Kimi Code.

xSpeed Hub is free and has no site cap. Connect your sites once and ask from the agent you already use.