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 Gemini CLI

Finding out why pages are not cached with Gemini CLI means asking it in your terminal to read xSpeed cache status and health checks through xSpeed Hub and name the check, setting or plugin that is holding page caching back.

list_sitesget_cache_statusget_healthrun_benchmarkget_benchmark_historyget_pro_audittoggle_cachecontact_support

Last updated: October 2026

Example session · Gemini CLI

You: Shop pages keep missing the cache. Use xSpeed Hub to check why.

get_cache_status(site: shop) read-only
→ page cache on, 18 cached pages, hit ratio 11% in the last 24h

get_health(site: shop) read-only
→ 1 warning: anonymous pages set a cookie that would make a shared copy wrong; other checks pass

Gemini CLI: xSpeed warns when logged-out visitors get a cookie that varies the page, because one cached copy could then be wrong for someone else. Something on shop sets it. Look at plugins and scripts that run for every visitor, and I will check again after you switch the likely one off.

You: Disabled the popup plugin.

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

Gemini CLI: The cookie warning is gone, so pages should cache again and the hit ratio should climb over the next day. I can run a benchmark to confirm a cache hit.

01

How Gemini CLI handles this

A site that should be fast keeps showing MISS. You are in the terminal with Gemini CLI and you ask: why are shop pages not cached? It lists your sites, then reads get_cache_status and get_health, and reports what it finds.

One health check people do not expect is the one for cookies. Page caching stores one copy for everyone, so a cookie that a plugin or a script sets on anonymous pages can make that shared copy wrong. xSpeed checks that anonymous pages are free of such cookies and reports a warning when they are not. Gemini CLI quotes the check, tells you to look for what sets a cookie for logged-out visitors, and re-reads get_health after you switch the likely culprit off.

Gemini CLI shows a confirmation for an MCP tool call unless the server entry sets trust to true or you started it with --approval-mode=yolo (or --yolo), which approves every tool call. You can proceed once, always allow that tool, always allow the whole server, or cancel. For a first diagnosis, leave it asking and approve the read calls as they come. If you want to see the X-XSpeed-Cache header yourself, ask it to request the page with a plain GET, not a HEAD request. Because Gemini CLI runs in your terminal, the answer stays next to your shell history. You can paste the failing check and its fix into a deploy note, then ask it to run get_health again when you are done. That second read is the proof that the warning cleared, and it costs nothing, since get_health only reads.

02

Set up Gemini CLI once

Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Gemini CLI 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 Gemini CLI

Run this once. --scope user writes the server to ~/.gemini/settings.json so it works in every project; without it Gemini CLI saves to the project's .gemini/settings.json, which is the default.

Terminal
gemini mcp add --scope user --transport http xspeedhub https://app.xspeedcache.com/xspeed/mcp

3Authenticate with /mcp auth

Start gemini and run /mcp auth xspeedhub. A browser page opens where you sign in to xSpeed Hub and approve access, and Gemini CLI receives the redirect on a local port. There is no token to paste, and the client keeps the credentials it receives. Run /mcp afterwards to check that xspeedhub shows as connected and lists its tools.

Text
/mcp auth xspeedhub
1 / 3

Full Gemini CLI 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. Gemini CLI shows a confirmation for an MCP tool call unless the server entry sets trust to true or you start Gemini CLI with --approval-mode=yolo (or --yolo), which approves every tool call. You can proceed once, always allow that tool, always allow the whole xspeedhub server, or cancel; the last two choices stop later prompts for those tools. Policy rules in ~/.gemini/policies can allow, deny or ask for a named tool by server and tool name. The Hub has no confirmation step of its own, so a trusted server, YOLO mode or an allow rule lets a write run as soon as your connection allows writes.

03

What do I ask?

Three prompts written for Gemini CLI. More for this job are below.

Prompt for Gemini CLI
Using xSpeed Hub, why do shop pages keep missing the cache? Read the health checks and name the one that explains it.
Prompt for Gemini CLI
Use xSpeed Hub to check whether anything makes anonymous visitors on shop receive a cookie that would make a shared copy wrong.
Prompt for Gemini CLI
With xSpeed Hub, run the benchmark on shop and compare the cached request with the uncached one.
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 Gemini CLI

Marking the xspeedhub server as trusted in Gemini CLI skips the prompt for every tool on it, not only the reads, and starting it with --approval-mode=yolo (or --yolo) approves every tool call on every server. That includes toggle_cache, purge_cache and contact_support, and choosing always allow for the whole server does the same for later calls. The Hub has no confirmation step of its own, and its request that the agent confirm first is guidance, not a lock. If you want a trusted server, use the connection token with Read-only everywhere on, or a Viewer sign-in: either refuses every write tool. It still allows contact_support, because the Hub counts that as a read.

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

It can name the check that fails, such as a cookie on anonymous pages or a second caching plugin, using the health report from xSpeed Hub. It cannot see which of your plugins sets a cookie, so you narrow that down and ask it to read the health report again.

Yes, unless you marked the server as trusted or started Gemini CLI with --approval-mode=yolo (or --yolo). Trust skips the prompt for every tool on that server, and yolo skips it for every tool call, so for anything that writes, avoid both or use a read-only Hub connection (the connection token with Read-only everywhere on, or a Viewer sign-in).

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 Gemini CLI

Documentation

From the blog

Find out why pages are not cached, from Gemini CLI.

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