PHPackages                             a7/wpe-cache-flush - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. a7/wpe-cache-flush

ActiveLibrary[Caching](/categories/caching)

a7/wpe-cache-flush
==================

Programmatically flush the WP Engine Cache

0.3.0.2(8y ago)374.2k8UnlicensePHPPHP &gt;=5.5.9

Since Jun 14Pushed 4y ago5 watchersCompare

[ Source](https://github.com/a7/wpe-cache-flush)[ Packagist](https://packagist.org/packages/a7/wpe-cache-flush)[ RSS](/packages/a7-wpe-cache-flush/feed)WikiDiscussions master Synced today

READMEChangelog (8)DependenciesVersions (6)Used By (0)

WP Engine Cache Flush
=====================

[](#wp-engine-cache-flush)

Purpose
-------

[](#purpose)

### What is this?

[](#what-is-this)

If you host on [wpengine](https://wpengine.com/) you may be familiar with their cache system, and even more likely: their 'Purge All Caches' button:

[![](https://camo.githubusercontent.com/7851b04d47f43b85ce95e6959ea103ace323f43968a63284277cbea5cfedd025/687474703a2f2f642e70722f692f5a544c714e772f4736424b314a67382b)](https://camo.githubusercontent.com/7851b04d47f43b85ce95e6959ea103ace323f43968a63284277cbea5cfedd025/687474703a2f2f642e70722f692f5a544c714e772f4736424b314a67382b)

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?

[](#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
-----

[](#setup)

### Composer

[](#composer)

Include via composer:

```
composer require a7/wpe-cache-flush
```

### Private Key

[](#private-key)

Create a [private key](https://www.random.org/strings/?num=10&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=html&rnd=new).

Set the private key one of three ways:

#### Constant

[](#constant)

Define the constant `WPE_CACHE_FLUSH` with they key:

```
define( 'WPE_CACHE_FLUSH', $private_key );
```

#### Filter

[](#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

[](#environmental-variable)

Set an environmental variable for `WPE_CACHE_FLUSH`

```
putenv( 'WPE_CACHE_FLUSH=' . $private_key );
```

Usage
-----

[](#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()
```

###  Health Score

32

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Total

5

Last Release

2966d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aacd1327a695e926c046e2c9bfcf2487581c8ed20b76a1bafa40515649d9baa3?d=identicon)[a7](/maintainers/a7)

---

Top Contributors

[![AaronHolbrook](https://avatars.githubusercontent.com/u/953022?v=4)](https://github.com/AaronHolbrook "AaronHolbrook (12 commits)")[![emersonthis](https://avatars.githubusercontent.com/u/1728139?v=4)](https://github.com/emersonthis "emersonthis (1 commits)")

### Embed Badge

![Health badge](/badges/a7-wpe-cache-flush/health.svg)

```
[![Health](https://phpackages.com/badges/a7-wpe-cache-flush/health.svg)](https://phpackages.com/packages/a7-wpe-cache-flush)
```

###  Alternatives

[snc/redis-bundle

A Redis bundle for Symfony

1.0k38.9M64](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

442107.1M36](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7391.2M2](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.1M1.1k](/packages/illuminate-cache)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165611.8k35](/packages/amphp-redis)[putyourlightson/craft-blitz

Intelligent static page caching for creating lightning-fast sites.

152466.6k21](/packages/putyourlightson-craft-blitz)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
