Title: WeAmp Cache Control for ModPageSpeed
Author: oschaaf
Published: <strong>2026 年 6 月 18 日</strong>
Last modified: 2026 年 6 月 18 日

---

搜索插件

![](https://ps.w.org/weamp-cache-control-for-modpagespeed/assets/banner-772x250.
png?rev=3576683)

![](https://ps.w.org/weamp-cache-control-for-modpagespeed/assets/icon.svg?rev=3576683)

# WeAmp Cache Control for ModPageSpeed

 作者：[oschaaf](https://profiles.wordpress.org/oschaaf/)

[下载](https://downloads.wordpress.org/plugin/weamp-cache-control-for-modpagespeed.0.1.0.zip)

 * [详情](https://cn.wordpress.org/plugins/weamp-cache-control-for-modpagespeed/#description)
 * [评价](https://cn.wordpress.org/plugins/weamp-cache-control-for-modpagespeed/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/weamp-cache-control-for-modpagespeed/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/weamp-cache-control-for-modpagespeed/#developers)

 [支持](https://wordpress.org/support/plugin/weamp-cache-control-for-modpagespeed/)

## 描述

This plugin is the control panel for ModPageSpeed — a web server optimization module
for nginx and Apache. ModPageSpeed must be installed and running on your server 
for this plugin to function. It is not a standalone caching plugin.

The plugin does three things:

 1. **Enables full-page caching** — adds `Cache-Control: public, max-age=N` to anonymous
    page responses (WordPress does not send this by default), with explicit bypasses
    for logged-in users, WooCommerce cart/checkout/account pages, search, feeds, and
    404s.
 2. **Keeps the cache fresh** — calls the ModPageSpeed purge API when you publish, 
    update, or delete content, when comments change, when stock levels change, and 
    when terms or theme settings change.
 3. **Gives you control in WP Admin and WP-CLI** — per-post-type TTLs, cookie bypass
    list, excluded URL patterns, a first-run setup wizard, and `wp pagespeed flush|
    status|test-connection` commands.

Works with both ModPageSpeed product lines (auto-detected), with one important difference:

 * **ModPageSpeed 2.0** caches full HTML pages itself — the plugin’s headers and
   purge calls drive the module’s page cache directly.
 * **mod_pagespeed / ngx_pagespeed 1.1** does not cache HTML (it is a streaming 
   rewriter; its in-place optimization caches only images, CSS, and JS). Full-page
   caching on 1.1 requires an external cache layer in front (nginx `proxy_cache`,
   Varnish, or a CDN) plus `ModifyCachingHeaders off` or `DownstreamCachePurgeLocationPrefix`—
   with 1.1’s default `ModifyCachingHeaders on`, the module replaces this plugin’s
   Cache-Control header on rewritten HTML. On 1.1, the plugin’s purge calls evict
   optimized sub-resources and metadata, not HTML pages.

#### Server requirements

 * ModPageSpeed 1.1 (v1.15.0+r3 or later) or ModPageSpeed 2.0 (v2.0.0 or later) 
   installed on your web server.
 * For 2.0: the worker admin API enabled (`--api-port`).
 * For full logged-in-user correctness an nginx cookie-bypass map block is required—
   the setup wizard provides a copy-paste snippet and verifies it.

#### WP-CLI

 * `wp pagespeed flush [--url=<url>]` — purge the home page (and posts page), or
   one specific URL on this site.
 * `wp pagespeed status` — detected product, version, license tier, purge prerequisites,
   and last-purge status.
 * `wp pagespeed test-connection` — verify the admin API is reachable and correctly
   configured (read-only, never purges).

#### License

This plugin is free software, licensed under the GNU General Public License v2.0
or later. The full GPL-2.0 license text is bundled with the plugin in the LICENSE
file.

### Third Party Services

This plugin makes HTTP requests to the operator-configured ModPageSpeed admin API
URL. Data sent includes page URLs (for cache purging) and an API key (for authentication).
No data is sent to We-Amp or any third party.

## 屏幕截图

[⌊Settings page: live server status, deployment prerequisites, and cache controls.⌉⌊
Settings page: live server status, deployment prerequisites, and cache controls.⌉[

Settings page: live server status, deployment prerequisites, and cache controls.

[⌊Setup wizard: six guided steps from server detection to a verified purge.⌉⌊Setup
wizard: six guided steps from server detection to a verified purge.⌉[

Setup wizard: six guided steps from server detection to a verified purge.

[⌊Automatic server detection and connection test against the admin API.⌉⌊Automatic
server detection and connection test against the admin API.⌉[

Automatic server detection and connection test against the admin API.

[⌊The wizard hands you the exact nginx cookie-bypass snippet your deployment needs.⌉⌊
The wizard hands you the exact nginx cookie-bypass snippet your deployment needs
.⌉[

The wizard hands you the exact nginx cookie-bypass snippet your deployment needs.

[⌊Final wizard check: a live test purge proves the invalidation path end to end.⌉⌊
Final wizard check: a live test purge proves the invalidation path end to end.⌉[

Final wizard check: a live test purge proves the invalidation path end to end.

## 安装

 1. Install ModPageSpeed on your server (see https://modpagespeed.com/).
 2. Install and activate this plugin.
 3. Follow the setup wizard under Settings > ModPageSpeed: detect your server, enter
    the admin API URL, test the connection, apply the nginx.conf snippet, enable caching,
    and run a test purge.

## 常见问题

### Does this plugin cache pages itself?

No. Caching happens server-side: in the ModPageSpeed 2.0 module itself, or — on 
1.1 — in your front cache (proxy_cache, Varnish, or CDN; the 1.1 module does not
cache HTML, see the Description). The plugin only sets cache headers and sends purge
requests — the same architecture as other server-layer cache plugins.

### I run mod_pagespeed / ngx_pagespeed 1.1 — do I get full-page caching?

Not from the module alone. 1.1 never caches HTML; put an external cache (nginx `
proxy_cache`, Varnish, or a CDN) in front of it and set `ModifyCachingHeaders off`(
or use `DownstreamCachePurgeLocationPrefix`) so this plugin’s Cache-Control headers
reach that cache. The plugin’s purge calls on 1.1 evict optimized sub-resources 
and metadata.

### Does it work without ModPageSpeed installed?

No. The setup wizard will guide you to the server module installation docs if no
server is detected.

## 评价

此插件暂无评价。

## 贡献者及开发者

「WeAmp Cache Control for ModPageSpeed」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ oschaaf ](https://profiles.wordpress.org/oschaaf/)

[帮助将「WeAmp Cache Control for ModPageSpeed」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/weamp-cache-control-for-modpagespeed)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/weamp-cache-control-for-modpagespeed/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/weamp-cache-control-for-modpagespeed/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/weamp-cache-control-for-modpagespeed/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/weamp-cache-control-for-modpagespeed/)。

## 更新日志

#### 0.1.0

 * Initial release: Cache-Control headers for anonymous pages, purge on publish/
   update/delete/comment/stock changes, ModPageSpeed 1.1 and 2.0 support with auto-
   detection, setup wizard, WP-CLI commands.

## 额外信息

 *  版本 **0.1.0**
 *  最后更新：**2 天前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 8.1 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/weamp-cache-control-for-modpagespeed/)
 * 标签
 * [cache](https://cn.wordpress.org/plugins/tags/cache/)[nginx](https://cn.wordpress.org/plugins/tags/nginx/)
   [optimization](https://cn.wordpress.org/plugins/tags/optimization/)[page cache](https://cn.wordpress.org/plugins/tags/page-cache/)
   [performance](https://cn.wordpress.org/plugins/tags/performance/)
 *  [高级视图](https://cn.wordpress.org/plugins/weamp-cache-control-for-modpagespeed/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/weamp-cache-control-for-modpagespeed/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/weamp-cache-control-for-modpagespeed/reviews/)

## 贡献者

 *   [ oschaaf ](https://profiles.wordpress.org/oschaaf/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/weamp-cache-control-for-modpagespeed/)