# Tune WordPress cache settings with GitHub Copilot in VS Code

> Tuning cache settings with GitHub Copilot in VS Code means asking its agent mode to read an xSpeed module's limits, propose a value inside them, and write it through xSpeed Hub after you confirm the tool call.

Page: https://xspeedcache.com/agent/github-copilot/cache-settings/
Last updated: October 2026

You are in VS Code with Copilot in agent mode, working on a site whose content changes a few times a year, and you ask for the longest cache lifetime xSpeed allows. Copilot calls list_sites, then list_modules and get_settings for the cache module. The module schema is part of what it reads, so it learns the lifetime is counted in hours and has an upper bound, instead of trying a year in seconds and failing.

What comes back is a proposal inside those limits: the current expiry, the largest value the module accepts, and a note that pages on a site this static can safely sit at the limit. The Hub tells the agent to briefly confirm intent before update_settings, so Copilot states the number and waits. After your yes it calls update_settings and returns the stored value. A request outside the limits refuses the whole call and stores nothing, Pro-only settings are refused without a licence, and credential fields are refused over the Hub.

What differs in Copilot is the confirmation dialog. VS Code starts in Manual permissions, so a tool call that is not auto-approved shows a confirmation, and you can allow it once, or for the session, the workspace or all future calls. Chat: Manage Tool Approval lists tools grouped by MCP server, so you can trust get_settings and list_modules while update_settings stays on a prompt. Allow all and Autopilot skip the prompts, and then the Hub runs a write as soon as the connection allows it. A chat request can enable at most 128 tools, and xSpeed adds 29 of them, so if you run many MCP servers, check the Configure Tools button to confirm the xSpeed tools are still enabled before you ask for a change.

## Set up GitHub Copilot in VS Code 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 your user mcp.json

Open the Command Palette and run MCP: Open User Configuration, then add this entry. Servers in your user profile are available in every workspace. MCP: Add Server walks you through the same thing, and the project-level .mcp.json file works too if you want the entry shared with your team; that file uses a top-level mcpServers object instead of servers.

File: `mcp.json (MCP: Open User Configuration)`

```json
{
  "servers": {
    "xspeedhub": {
      "type": "http",
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}
```

### 3. Start the server and sign in

Run MCP: List Servers, pick xspeedhub and choose Start. VS Code asks whether you trust the server, then opens a browser page where you sign in to xSpeed Hub and approve access. There is no token to paste, and VS Code keeps the credentials it receives. Open the Chat view and use the Configure Tools button to see the xSpeed tools.

```
MCP: List Servers
```

Full setup: https://xspeedcache.com/agent/github-copilot/

### 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 VS Code the default permission level is Manual permissions: a tool call that is not auto-approved shows a confirmation, and you can allow it once or for the session, the workspace or all future calls. Chat: Manage Tool Approval lists tools grouped by MCP server, so you can trust get_cache_status and the other reads while purge_cache and update_settings stay on a prompt. Allow all, Autopilot and global auto-approval skip those prompts, including for external tool calls, and then a write runs as soon as your connection allows writes. xSpeed Hub has no confirmation step of its own.

## Prompts

- Using xSpeed Hub, what is the longest page cache lifetime allowed on blog? Read the module settings first, then propose a value.
- With xSpeed Hub, set the cache expiry on blog to the maximum, tell me the old and new values, and wait for my yes.
- Ask xSpeed Hub for every setting in the cache module on shop and flag any that look risky for a store.

## Example session

```
You: Blog changes twice a year. Use xSpeed Hub to keep its pages cached for a year.
  → list_modules(site: blog) [read-only]: cache: cache_expiry, whole hours, 1 to 720
  → get_settings(site: blog, module: cache) [read-only]: cache_expiry 24
Agent: A year is 8,760 hours, and the module stops at 720, which is 30 days. I would set 720. Apply that to blog?
You: Yes, use the maximum.
  → update_settings(site: blog, module: cache, values: { cache_expiry: 720 }) [changes site]: stored, cache expiry now 720 hours
Agent: Done. Pages now live for 30 days. Purge the blog cache when you publish something that must appear right away.
```

## How it works

1. **List the modules**: list_modules returns every Free and Pro module available on one site, with its settings schema and status. It tells the agent which module slugs exist, such as minify or gzip, and what each setting accepts.
2. **Read the current settings**: get_settings takes a module slug and returns its settings. Credential fields come back masked, so an agent cannot read a stored API token or password back in plain text.
3. **Change them**: update_settings takes the module and a values object of setting keys. The site checks the whole object first. If any key is unknown, any value is outside the schema, or a field is pinned by a constant in wp-config.php, it refuses the write, writes nothing and says which keys and why, sometimes with a "did you mean" hint.
4. **Turn page caching on or off**: Page caching has its own tool, toggle_cache, because it installs or removes the cache drop-in and the WP_CACHE constant. Asking update_settings to set cache_enabled does not work and is refused. If another caching plugin owns the drop-in, the site declines to enable xSpeed and returns blocked: true with the reason.
5. **Check the effect**: The result of a settings write is the stored settings. A module can add a warning when a setting is saved but has no effect on this server, for example Brotli on a server without the module for it, and the agent should pass that on. run_benchmark then times cached against uncached to see whether the change helped.
6. **Apply to many sites only after reading one**: update_settings and toggle_cache accept site: "all" or a list of handles. Each site validates against its own schema and answers in its own row, so a module missing on one site fails that row and the others still apply. Read one site first, then apply.

## Reference

| | |
| --- | --- |
| Discover | list_modules (read): Free and Pro modules, settings schema, status, per site |
| Read settings | get_settings (read): argument module; credential fields masked |
| Change settings | update_settings (write): arguments module and values; validated by the site |
| Bad input | The whole write is refused and nothing is written; the error names the keys and reasons |
| Page cache on or off | toggle_cache (write): argument enabled; cache_enabled in update_settings is refused |
| Blocked by another plugin | toggle_cache returns blocked: true with blocked_reason when another plugin owns the cache drop-in |
| Every site at once | update_settings and toggle_cache accept site: "all" or a list of handles, one result per site |
| Pro modules | A Pro module on a site without an active licence cannot be read or written; the site refuses |
| Credential fields | Refused by default over MCP; set them in the xSpeed dashboard, not through the agent |
| Read-only connection | The connection token with Read-only everywhere on, or a Viewer member's sign-in: update_settings and toggle_cache are refused; list_modules and get_settings still work. An OAuth sign-in gets the scopes the client asks for, read and write by default, clamped to the member's role |
| Confirmation | None on the Hub; the Hub tells the agent to briefly confirm intent for these two, and your client's prompt is the gate |

## Rules

- Read before you write. Ask for list_modules and get_settings first, so the agent changes real keys with valid values instead of guessing.
- update_settings and toggle_cache change how a live site behaves. They run as soon as your connection allows writes. The Hub tells the agent to briefly confirm intent first, which is guidance to the agent, so your 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. The switch does not limit an OAuth sign-in.
- For site: "all", the Hub tells the agent to confirm once with "this will touch all N sites", then make one call. The result is per site, and some sites failing is a partial result to report, not a blanket success or failure.
- Do not ask an agent to set credentials such as a Cloudflare token or Redis password. The site refuses those writes by default, and they belong in the xSpeed dashboard.
- If a settings result says a value is saved but inactive on this server, relay that. Do not tell the user the feature is enabled.

## Good to know with GitHub Copilot in VS Code

If you allow the xSpeed tools for the whole workspace in the confirmation dialog, or choose Allow all or Autopilot, later update_settings and toggle_cache calls run without a prompt. Choose the once or session option for the writes, or allow only the read tools. Also keep an eye on the tool picker: a chat request can enable at most 128 tools, and a long list of other MCP servers can leave you without some xSpeed tools.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Use xSpeed Hub to list the modules on shop and tell me which ones are off.
- Ask xSpeed Hub for the current minify settings on blog.
- With xSpeed Hub, turn on HTML minification on blog, then benchmark the cache and tell me if it helped.
- Use xSpeed Hub to turn page caching off on staging while I debug, and tell me when it is off.
- Using xSpeed Hub, read the gzip settings on shop first, then enable the same options on every site.
- Use xSpeed Hub to set the page cache lifespan on docs to 30 days, and if the site refuses it, tell me why.

## Frequently asked questions

### Will Copilot try a value the cache module cannot accept?

It reads the module settings first, which include the allowed range, so it usually stays inside the limits. If it does send a bad value, the module returns an error and stores nothing. Ask Copilot to read the range with get_settings and try again.

### Does allowing a tool for the workspace cover settings changes?

Yes, once you allow update_settings for the workspace, VS Code stops asking for it there. The Hub then relies on a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) and the agent's own request to confirm. Allow reads for the workspace and keep the session option for writes.

### How does an agent know which settings exist?

It calls list_modules for the site, which returns every available module with its settings schema and status, then get_settings for the one module it wants to change. The schema says which keys exist and what values each accepts.

### What happens if the agent sends a wrong setting key?

The site refuses the whole update and writes nothing. The error names the keys it rejected and why, such as an unknown key, a value outside the allowed range, or a field fixed by a constant in wp-config.php, and it can suggest the nearest valid key.

### How do I turn page caching on or off with an agent?

Use toggle_cache with enabled set to true or false. It installs or removes the cache drop-in and the WP_CACHE constant. Setting cache_enabled through update_settings does not work. If another caching plugin already owns the drop-in, the site will not enable xSpeed and says why.

### Can one prompt change settings on all of my sites?

Yes. update_settings and toggle_cache accept site: "all", and the Hub runs the sites one after another with a one-second pause and returns a result per site. Each site checks the values against its own schema, so a site that lacks the module fails its own row while the others apply.

### Can the agent change my Cloudflare or Redis credentials?

Not by default. Writing credential fields over MCP is off unless the site owner allows it, and the site refuses the write and names the fields. Set credentials in the xSpeed dashboard. Credential values also come back masked when an agent reads settings.

## Tune cache settings with other agents

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

## More with GitHub Copilot in VS Code

- [Purge the WordPress cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/purge-cache/)
- [Find out why WordPress pages are not cached with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/troubleshoot-cache/)
- [Scan a website for speed problems with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/speed-scan/)
- [Run and track PageSpeed tests with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/pagespeed-tests/)
- [Raise a WordPress site's PageSpeed score with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/optimize-site/)
- [Warm the WordPress cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/preload-cache/)
- [Set up the Redis object cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/object-cache/)
- [Manage Cloudflare caching with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/cloudflare/)
- [Manage every WordPress site at once with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/fleet/)

## Documentation

- How to enable Page Cache: https://xspeedcache.com/docs/page-cache/
- How to minify CSS and JavaScript: https://xspeedcache.com/docs/minify/
- How to add cache rules and bypasses: https://xspeedcache.com/docs/rules-and-bypass/
- Site MCP tool reference: https://xspeedcache.com/docs/mcp-tool-reference/
