a7/wpe-cache-flush
Composer 安装命令:
composer require a7/wpe-cache-flush
包简介
Programmatically flush the WP Engine Cache
README 文档
README
Purpose
What is this?
If you host on wpengine you may be familiar with their cache system, and even more likely: their 'Purge All Caches' button:
Unfortunately, WP Engine has not yet offered a programmatic way to purge the cache for your site (i.e. using a simple webhook).
I did some digging and discovered that the functionality for the WP Engine's cache purge is all within mu-plugins and have combine the cache purging functionality and a simple webhook request to achieve a programmatic way to clear your site's cache (object cache AND varnish full page cache).
Why would I use this?
If you deal with any sort of deployment, build, or continuous delivery system, you know how important having a programmatic way to do everything is. In this case, clearing the cache is crucial to be able to run acceptance tests and verify that the new changes have not caused any regressions.
This clears the cache for sites hosted on WP Engine.
Setup
Composer
Include via composer:
composer require a7/wpe-cache-flush
Private Key
Create a private key.
Set the private key one of three ways:
Constant
Define the constant WPE_CACHE_FLUSH with they key:
define( 'WPE_CACHE_FLUSH', $private_key );
Filter
Add a filter to \A7\WPE_Cache_Flush\wpe_cache_flush_token and return the token as a string
add_filter( '\A7\WPE_Cache_Flush\wpe_cache_flush_token', function() { return $private_key; } );
Environmental Variable
Set an environmental variable for WPE_CACHE_FLUSH
putenv( 'WPE_CACHE_FLUSH=' . $private_key );
Usage
Make a GET request to your site's URL with the query parameter ?wpe-cache-flush=$private_key.
GET http://example.com/?wpe-cache-flush=$private_key
You can also call the flush function directly from your code via
\A7\WPE_Cache_Flush\cache_flush()
a7/wpe-cache-flush 适用场景与选型建议
a7/wpe-cache-flush 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.18k 次下载、GitHub Stars 达 37, 最近一次更新时间为 2017 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 a7/wpe-cache-flush 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 a7/wpe-cache-flush 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 37
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unlicense
- 更新时间: 2017-06-14