Title: OPcache Reset
Author: Danila Vershinin
Published: <strong>2018 年 6 月 1 日</strong>
Last modified: 2025 年 12 月 15 日

---

搜尋外掛

![](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://tw.wordpress.org/plugins/opcache-reset/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/opcache-reset/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/opcache-reset/#developers)

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

## 外掛說明

這個外掛會在更新 WordPress 核心程式、佈景主題及檔案後清除 OPcache 快取。與其他外掛
不同，這個外掛與[透過 Linux cron 執行 WordPress 更新](https://www.getpagespeed.com/server-setup/performance-friendly-wordpress-updates)
相容。

### 外掛功能

 * 在更新 WordPress 核心程式/外掛/佈景主題後自動重設 OPcache。
 * 清除記憶體及檔案層級的 OPcache 快取。
 * 可以與 cron 命令執行的 WordPress 更新搭配使用。
 * 提供手動管理 OPcache 快取的 WP-CLI 命令。
 * 沒有外部相依性 (cachetool 為選用支援)。

### 組態方式

這個外掛會自動處理網頁更新。如果要使用 CLI 進行更新 (例如 cron 或 WP-CLI)，必須組
態伺服器上的 PHP-FPM 通訊端：

**方法 1：在 WordPress 網站跟目錄建立 `.cachetool.yml` 檔案：**

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

**方法 2：使用 cachetool 二進位檔案** (必須已安裝在 PATH 環境變數中)

### WP-CLI 命令

使用命令列重設 OPcache 快取：

    ```
    wp opcache reset
    ```

顯示 OPcache 快取狀態及統計資料：

    ```
    wp opcache status
    ```

將 OPcache 快取狀態輸出為 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**
 *  最後更新 **5 個月前**
 *  啟用安裝數 **300+**
 *  WordPress 版本需求 ** 5.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.9.4**
 *  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://tw.wordpress.org/plugins/tags/cache/)[OPcache](https://tw.wordpress.org/plugins/tags/opcache/)
   [php](https://tw.wordpress.org/plugins/tags/php/)[wp-cli](https://tw.wordpress.org/plugins/tags/wp-cli/)
   [Zend](https://tw.wordpress.org/plugins/tags/zend/)
 *  [進階檢視](https://tw.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)