Title: API Cache Pro
Author: Hubbard Labs
Published: <strong>2019 年 9 月 30 日</strong>
Last modified: 2022 年 4 月 18 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/api-cache-pro.svg)

# API Cache Pro

 由 [Hubbard Labs](https://profiles.wordpress.org/hubbardlabs/) 開發

[下載](https://downloads.wordpress.org/plugin/api-cache-pro.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/api-cache-pro/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/api-cache-pro/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/api-cache-pro/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/api-cache-pro/#developers)

 [技術支援](https://wordpress.org/support/plugin/api-cache-pro/)

## 外掛說明

This plugin enables caching for the WordPress REST API to improve performance. Once
enabled you can modify the basic settings via the Customizer.

#### Customizer Options:

 * Disable Cache (Default: Disabled)
 * Set Default Cache Timeout (Default: 300)

### Request Headers

Several Headers are added to all the API Requests. This plugin will also modify 
the Cache-Control header as well. Here is an example of the available custom headers.

    ```
    X-API-CACHE-PRO: Cached
    X-API-CACHE-PRO-EXPIRES: January 20, 2019, 12:39 AM UTC
    X-API-CACHE-PRO-EXPIRES-DIFF: 5 mins
    X-API-CACHE-PRO-KEY: api_cache_pro_78be25416f69cd3a885dcf14017a0691
    ```

 * **X-API-CACHE-PRO** – Displays Cached, or Not Cached.
 * **X-API-CACHE-PRO-EXPIRES** – Displays the date/time the cache is set to expire.
 * **X-API-CACHE-PRO-EXPIRES-DIFF** – Displays the difference from current time 
   to the time cache is set to expire.
 * **X-API-CACHE-PRO-KEY** – Displays the key used for the cache.

This plugin offers several filters so you can disable these headers:

 Filter
 Type Default

 `api_cache_pro_header`
 boolean true

 `api_cache_pro_key_header`
 boolean true

 `api_cache_pro_expires_header`
 boolean true

 `api_cache_pro_expires_diff_header`
 boolean true

 `api_cache_pro_control_header`
 boolean true

 `api_cache_pro_max_age`
 integer Default Timeout or 300 (5 Minutes)

 `api_cache_pro_s_max_age`
 integer Default Timeout or 300 (5 Minutes)

You can use these filters to disable any of the headers. Here is an example to disable
the Key Header.

    ```
    /**
     * Disable API Cache Pro Key Header.
     *
     * @access public
     */
    function disable_api_cache_pro_key_header() {
        return false;
    }
    add_action( 'api_cache_pro_key_header', 'disable_api_cache_pro_key_header' );
    ```

### Clearing Cache

The cache will automatically get cleared if you do any of the following:

 * Disable the Cache
 * Update the Default Cache Timeout Length
 * Update any post, page or custom post type.
 * Deactivate or Uninstall the plugin

You can skip that cache by adding the following param to any request:

    ```
    `cache=disabled<pre><h3>WP-CLI Support</h3>
    ```

_API Cache Pro_ offers wp-cli support to clear cache with the following command:

wp api-cache-pro delete
 `

## 安裝方式

 1. Copy the `api-cache-pro` folder into your `wp-content/plugins` folder
 2. Activate the `API Cache Pro` plugin via the plugin admin page

## 常見問題集

FAQ Coming Soon!

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈API Cache Pro〉的開發相關工作。

參與者

 *   [ Hubbard Labs ](https://profiles.wordpress.org/hubbardlabs/)
 *   [ Brandon Hubbard ](https://profiles.wordpress.org/bhubbard/)

[將〈API Cache Pro〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/api-cache-pro)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/api-cache-pro/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/api-cache-pro/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/api-cache-pro/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/api-cache-pro/)。

## 變更記錄

Please see [CHANGELOG.MD](https://tw.wordpress.org/plugins/api-cache-pro/CHANGELOG.md?output_format=md)

## 中繼資料

 *  版本 **0.0.4**
 *  最後更新 **4 年前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 5.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **5.2.24**
 *  PHP 版本需求 ** 7.0 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/api-cache-pro/)
 * 標籤:
 * [api](https://tw.wordpress.org/plugins/tags/api/)[cache](https://tw.wordpress.org/plugins/tags/cache/)
 *  [進階檢視](https://tw.wordpress.org/plugins/api-cache-pro/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/api-cache-pro/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/api-cache-pro/reviews/)

## 參與者

 *   [ Hubbard Labs ](https://profiles.wordpress.org/hubbardlabs/)
 *   [ Brandon Hubbard ](https://profiles.wordpress.org/bhubbard/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/api-cache-pro/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://hubbardlabs.com)