[wordpress插件] API Cache ProAPI缓存专业版

wordpress 插件 文章 2020-02-19 18:40 565 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin enables caching for the WordPress REST API to improve performance.

此插件可为WordPress REST API进行缓存以提高性能。

Once enabled you can modify the basic settings via the Customizer.

启用后,您可以通过定制程序修改基本设置。

Customizer Options:

自定义选项:

    • Disable Cache (Default: Disabled)
    • 禁用缓存(默认:禁用)

    • Set Default Cache Timeout (Default: 300)
    • 设置默认缓存超时(默认值:300)

    Request Headers

    请求标头

    Several Headers are added to all the API Requests.

    几个标头被添加到所有API请求中。

    This plugin will also modify the Cache-Control header as well.

    该插件还将修改Cache-Control标头。

    Here is an example of the available custom headers.

    这是可用的自定义标头的示例。

    X-API-CACHE-PRO: Cached

     X-API-CACHE-PRO:已缓存

    X-API-CACHE-PRO-EXPIRES: January 20, 2019, 12:39 AM UTC

    X-API-CACHE-PRO-EXPIRES:UTC一月20,2019,12:39

    X-API-CACHE-PRO-EXPIRES-DIFF: 5 mins

    X-API-CACHE-PRO-EXPIRES-DIFF:5分钟

    X-API-CACHE-PRO-KEY: api_cache_pro_78be25416f69cd3a885dcf14017a0691

    X-API-CACHE-PRO-KEY:api_cache_pro_78be25416f69cd3a885dcf14017a0691

      • X-API-CACHE-PRO – Displays Cached, or Not Cached.
      • X-API-CACHE-PRO –显示已缓存或未缓存。

      • X-API-CACHE-PRO-EXPIRES – Displays the date/time the cache is set to expire.
      • X-API-CACHE-PRO-EXPIRES –显示缓存设置为过期的日期/时间。

      • X-API-CACHE-PRO-EXPIRES-DIFF – Displays the difference from current time to the time cache is set to expire.
      • X-API-CACHE-PRO-EXPIRES-DIFF –显示从当前时间到缓存设置为过期时间的时间。

      • X-API-CACHE-PRO-KEY – Displays the key used for the cache.
      • X-API-CACHE-PRO-KEY –显示用于缓存的密钥。

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

      此插件提供了几个过滤器,因此您可以禁用以下标头:

      Filter
        

      过滤器
        

      Type
        

      类型
        

      Default

      默认

      api_cache_pro_header
        

      api_cache_pro_header
        

      boolean
        

      布尔
        

      true

      api_cache_pro_key_header
        

      api_cache_pro_key_header
        

      boolean
        

      布尔
        

      true

      api_cache_pro_expires_header
        

      api_cache_pro_expires_header
        

      boolean
        

      布尔
        

      true

      api_cache_pro_expires_diff_header
        

      api_cache_pro_expires_diff_header
        

      boolean
        

      布尔
        

      true

      api_cache_pro_control_header
        

      api_cache_pro_control_header
        

      boolean
        

      布尔
        

      true

      api_cache_pro_max_age
        

      api_cache_pro_max_age
        

      integer
        

      整数
        

      Default Timeout or 300 (5 Minutes)

      默认超时或300(5分钟)

      api_cache_pro_s_max_age
        

      api_cache_pro_s_max_age
        

      integer
        

      整数
        

      Default Timeout or 300 (5 Minutes)

      默认超时或300(5分钟)

      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. 

      *禁用API缓存专业版密钥标题。 

      * @access public 

      * @公开访问 

      */

      * /

      function disable_api_cache_pro_key_header() {    

      函数disable_api_cache_pro_key_header(){    

      return false;

      返回false;

      }

      }

      add_action( 'api_cache_pro_key_header', 'disable_api_cache_pro_key_header' );

      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

        WP-CLI Support

         `cache = disabled 
         

        WP-CLI支持

        API Cache Pro offers wp-cli support to clear cache with the following command:

        API Cache Pro 提供wp-cli支持,可使用以下命令清除缓存:

        wp api-cache-pro delete
            

        wp api-cache-pro删除
            

        `

        `

安装步骤

    1. Copy the api-cache-pro folder into your wp-content/plugins folder
    2. api-cache-pro 文件夹复制到您的 wp-content / plugins 文件夹

    3. Activate the API Cache Pro plugin via the plugin admin page
    4. 通过插件管理页面激活 API Cache Pro 插件

下载地址
https://downloads.wordpress.org/plugin/api-cache-pro.zip
-EOF-

AI助手支持GPT4.0