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 OpenCode

Finding out why pages are not cached with OpenCode means asking it in your terminal to read xSpeed cache status and health checks through xSpeed Hub and find the setting, permission or plugin that blocks page caching.

list_sitesget_cache_statusget_healthrun_benchmarkget_benchmark_historyget_pro_audittoggle_cachecontact_support

Last updated: October 2026

Example session · OpenCode

You: Caching is on for docs but nothing gets cached. Use xSpeed Hub to find out why.

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

get_health(site: docs) read-only
→ 1 warning: cache directory is not writable; other checks pass

OpenCode: Without write access to the cache directory nothing can be cached, whatever the switches say. Fix the directory permissions on the server so the web server user can write to it. xSpeed cannot do that from here. Tell me when it is fixed.

You: Fixed.

run_benchmark(site: docs) read-only
→ home page: 455 ms uncached, 57 ms cached, cached request was a hit

OpenCode: That did it. The home page now serves from the cache.

01

How OpenCode handles this

The cache stats show zero cached pages on a site that has caching switched on. You are in the terminal with OpenCode and you ask: caching is on for docs but nothing gets cached, why? It lists your sites and reads get_cache_status, and the cached page count is 0.

get_health then reports the cause: the cache directory is not writable. Without write access nothing can be cached, whatever the switches say. OpenCode names the check and tells you what to fix: the permissions on the cache directory, which you change on the server and not through xSpeed. After you fix it, you ask for run_benchmark again, and the cached request should now be a hit. Other causes read the same way, for example a missing drop-in or a competing caching plugin.

OpenCode's permission rules set a tool to ask, allow or deny, but most permissions default to allow, so with no rule of yours every Hub tool runs without a prompt, contact_support included. Add an ask rule for every name that starts with xspeedhub_, then allow rules for the xspeedhub_get_ and xspeedhub_list_ names, because the last matching rule wins. That fits this job well: the reads run, anything else asks, and you can deny a tool you never want used from a coding session. It is a short loop because OpenCode stays in the terminal where you will make the fix. You change the permissions, return to the same session, and ask it to read the benchmark again. The history stays in one place, so you can see the warning, the change and the result next to each other.

02

Set up OpenCode once

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

Put this block in your global config, or in opencode.json at a project root to scope it to that project. OpenCode reads both JSON and JSONC. No other field is needed: when the Hub answers 401, OpenCode starts the OAuth flow and registers itself through dynamic client registration.

~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "xspeedhub": {
      "type": "remote",
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}

3Sign in with opencode mcp auth

Run this once. It opens a browser page on xSpeed Hub where you sign in and approve access. There is no token to paste; OpenCode stores the credentials it receives. Run opencode mcp list to see the server and its auth status, and opencode mcp debug xspeedhub if the connection fails.

Terminal
opencode mcp auth xspeedhub
1 / 3

Full OpenCode 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. OpenCode checks MCP tools against its permission rules under the prefixed name, such as xspeedhub_purge_cache, and most permissions default to allow. With no rule of yours in place, a Hub write tool runs without a prompt. Add rules to change that: "xspeedhub_*": "ask" first, then "xspeedhub_get_*": "allow" and "xspeedhub_list_*": "allow", because the last matching rule wins. A deny rule holds even under opencode --auto, which approves everything that is not denied. The Hub itself has no confirmation step, so these rules and read-only access are the gates. For read-only access, send the connection token with Read-only everywhere on, or sign in as a Viewer member.

03

What do I ask?

Three prompts written for OpenCode. More for this job are below.

Prompt for OpenCode
Caching is on for docs but nothing is cached. Use xSpeed Hub to read the status and the health report and name the failing check.
Prompt for OpenCode
With xSpeed Hub, run the benchmark on docs again and tell me whether the cached request hits now.
Prompt for OpenCode
List every check in the xSpeed Hub get_health report for docs that is not a pass, with what each one means.
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 OpenCode

A deny rule in OpenCode is a real lock, and it holds even under opencode --auto; the Hub's own instructions are not. xSpeed Hub has no confirmation step, and its request that the agent confirm first is guidance only. If you never want OpenCode to email support from a coding session, set xspeedhub_contact_support to deny or ask in its permission rules instead of relying on the agent to remember. A read-only Hub connection will not do it for you, because the Hub counts contact_support 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

No. It can read the failing check through xSpeed Hub and tell you what to change, but file permissions on the server are outside what the Hub can do. After you change them, ask it to run the benchmark again.

Most OpenCode permissions default to allow, so add a rule that sets xspeedhub_contact_support to deny or ask. The Hub only tells the agent to confirm the message with you, which is guidance and not a lock, and a read-only connection does not stop it.

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 OpenCode

Documentation

From the blog

Find out why pages are not cached, from OpenCode.

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