PHPackages                             goatherd/gh-cache - 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. goatherd/gh-cache

ActiveWordpress-plugin[Caching](/categories/caching)

goatherd/gh-cache
=================

Generic request cache layer for wordpress and nginx modules.

1.0(12y ago)060[3 issues](https://github.com/goatherd/wp-cache/issues)MITPHP

Since May 15Pushed 12y ago1 watchersCompare

[ Source](https://github.com/goatherd/wp-cache)[ Packagist](https://packagist.org/packages/goatherd/gh-cache)[ Docs](https://github.com/goatherd/wp-cache)[ RSS](/packages/goatherd-gh-cache/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

gh-cache
========

[](#gh-cache)

WordPress request cache layer.

By default serves nginx reverse proxy/ fastcgi cache modules but is extendedable to use any request caching backend.

Features
--------

[](#features)

- generic request cache layer
- cache, cache-veto and purge events
- prepare event on `plugins loaded` hook
- defines time-to-live filter (with implicite veto for non-positive times)
- default event handlers (cache, veto, purge)

### Requirements

[](#requirements)

- PHP 5.3 or newer
- WordPress 3.8+ (may work with older releases)

Default configuration features
------------------------------

[](#default-configuration-features)

- enables proxy caching through `X-accel-expires` header
- flushes cache on comment
- flushes cache on post publish/ edit
- flush some related posts by default
- selectivly bypasses cache
- can veto through `gh-cache-veto` filter
- can override time-to-live through `gh-cache-ttl` filter
- can extend purge to cover related URLs

### Requirements

[](#requirements-1)

- nginx
- php curl module
- can edit vhost configuration

### Installation

[](#installation)

- **TODO** explain nginx config (simple)
- **TODO** explain nginx config (full)
- **TODO** explain nginx config (advanced purge for nginx 1.5.7+ and purge module)

Incompatibilities
-----------------

[](#incompatibilities)

- Set-Cookie headers prevent caching If your WordPress installation relies on sessions caching will be rather limited or impossible to archive
- Cache is flushed by URL: one-at-a-time If your WordPress installation requires huge networks of related posts to be flushed you should use other methods
- Your WordPress installation is required to be cacheable. The most common criteria is to serve static content (and AJAX dynamic parts) for the majority of requests.
- Not intended for user (agent) level caching

Technical Notes
---------------

[](#technical-notes)

PSR-4 compliant code approximating [SOLID](http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29) priciples.

Currently only nginx proxy and fastcgi caching is supported.

Due to limitations of the nginx cache implementation URLs can only be flushed one-at-a-time. Wildcard flush or full flush is not directly supported.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

4382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c0597339c399bea9497c59ad70ec933e5a6c95458122649baf2dab18038ba88?d=identicon)[goatherd](/maintainers/goatherd)

---

Tags

wordpresscachenginx

### Embed Badge

![Health badge](/badges/goatherd-gh-cache/health.svg)

```
[![Health](https://phpackages.com/badges/goatherd-gh-cache/health.svg)](https://phpackages.com/packages/goatherd-gh-cache)
```

###  Alternatives

[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23817.0k1](/packages/rtcamp-nginx-helper)[rarst/fragment-cache

WordPress plugin for partial and async caching of heavy front-end elements.

14115.0k2](/packages/rarst-fragment-cache)

PHPackages © 2026

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