Title: OPcache Reset
Author: Danila Vershinin
Published: <strong>2018 年 6 月 1 日</strong>
Last modified: 2026 年 5 月 21 日

---

搜索插件

![](https://ps.w.org/opcache-reset/assets/banner-772x250.png?rev=3419574)

![](https://ps.w.org/opcache-reset/assets/icon.svg?rev=3419574)

# OPcache Reset

 作者：[Danila Vershinin](https://profiles.wordpress.org/dvershinin/)

[下载](https://downloads.wordpress.org/plugin/opcache-reset.2.4.0.zip)

 * [详情](https://cn.wordpress.org/plugins/opcache-reset/#description)
 * [评价](https://cn.wordpress.org/plugins/opcache-reset/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/opcache-reset/#developers)

 [支持](https://wordpress.org/support/plugin/opcache-reset/)

## 描述

This plugin clears OPcache after updating WordPress core, themes, and files.
 Unlike
other plugins, it is also compatible with [WordPress updates made by Linux cron](https://www.getpagespeed.com/server-setup/performance-friendly-wordpress-updates).

### Features

 * Automatic OPcache reset after plugin/theme/core updates
 * Clears both memory-based and file-based OPcache
 * Works with cron-based WordPress updates (CLI context)
 * WP-CLI commands for manual OPcache management
 * Zero external dependencies (optional cachetool support)

### Configuration

The plugin works automatically for web-based updates. For CLI-based updates (cron,
WP-CLI), configure your PHP-FPM socket:

**Option 1: Create `.cachetool.yml` in your WordPress root:**

    ```
    adapter: fastcgi
    fastcgi: /run/php-fpm/www.sock
    ```

**Option 2: Use cachetool binary** (if installed in PATH)

### WP-CLI Commands

Reset OPcache from the command line:

    ```
    wp opcache reset
    ```

Show OPcache status and statistics:

    ```
    wp opcache status
    ```

Output status as JSON:

    ```
    wp opcache status --format=json
    ```

## 评价

![](https://secure.gravatar.com/avatar/bdd6d3a0444ba0b213f7ce42cc7fa01ae5f4a0b76f182675c91edb64b0ea2eb6?
s=60&d=retro&r=g)

### 󠀁[Good !](https://wordpress.org/support/topic/good-4504/)󠁿

 [geoffreymerck](https://profiles.wordpress.org/geoffreymerck/) 2019 年 5 月 27 
日

This almost what I have been looking for. The OPCache is also reset when installing
new plugins, but not when deinstalling.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/opcache-reset/reviews/)

## 贡献者及开发者

「OPcache Reset」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Danila Vershinin ](https://profiles.wordpress.org/dvershinin/)

「OPcache Reset」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/opcache-reset/contributors)
为本插件所做的贡献。

[帮助将「OPcache Reset」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/opcache-reset)

### 对开发感兴趣吗?

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

## 更新日志

#### 2.4.0

 * Added WP-CLI commands: `wp opcache reset` and `wp opcache status`
 * Added direct FastCGI communication (no cachetool dependency required)
 * Added support for cachetool.yml configuration format
 * Added end-to-end FastCGI testing
 * Improved test coverage (34 tests)

#### 2.3.0

 * Added comprehensive Docker-based integration test suite (27 tests)
 * Added GitHub Actions CI for linting and testing
 * Added PHPStan and PHPCS for code quality
 * Improved OPcache reset verification with validate_timestamps=0 testing
 * Added pre-commit hooks for automated code checks
 * Updated plugin assets (icons, banners)

#### 2.2.0

 * Added support for file-based OPcache clearing with race condition handling
 * Improved cachetool invocation with proper PATH handling

#### 2.1.2

 * No calling cachetool opcache:reset for setups with only file cache

#### 2.1.0

 * Handle file OPcaches in a consistent fashion

#### 2.0.0

 * Handle file OPCaches

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **2.4.0**
 *  最后更新：**4 天前**
 *  活跃安装数量 **300+**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/opcache-reset/) 和 [English (US)](https://wordpress.org/plugins/opcache-reset/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/opcache-reset)
 * 标签
 * [cache](https://cn.wordpress.org/plugins/tags/cache/)[OPcache](https://cn.wordpress.org/plugins/tags/opcache/)
   [php](https://cn.wordpress.org/plugins/tags/php/)[wp-cli](https://cn.wordpress.org/plugins/tags/wp-cli/)
   [Zend](https://cn.wordpress.org/plugins/tags/zend/)
 *  [高级视图](https://cn.wordpress.org/plugins/opcache-reset/advanced/)

## 评级

 4 星（最高 5 星）。

 *  [  0 条 5 星评价     ](https://wordpress.org/support/plugin/opcache-reset/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/opcache-reset/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/opcache-reset/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/opcache-reset/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/opcache-reset/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/opcache-reset/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/opcache-reset/reviews/)

## 贡献者

 *   [ Danila Vershinin ](https://profiles.wordpress.org/dvershinin/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/opcache-reset/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://github.com/sponsors/dvershinin)