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

wordpress 插件 文章 2020-02-19 18:40 640 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


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Cookbook Hook Guide食谱挂钩指南
[wordpress插件] Delete Old Comments删除旧评论
[wordpress插件] Custom Admin Columns自定义管理员列
[wordpress插件] Advanced Custom Fields – Menu Field add-on高级自定义字段–菜单字段附加组件
[wordpress插件] Biz Calendar商业日历
随便看看
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4799
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472