PHPackages                             alleyinteractive/wp-404-caching - 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. alleyinteractive/wp-404-caching

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

alleyinteractive/wp-404-caching
===============================

Full Page Cache for WordPress 404s

v1.3.0(9mo ago)12335.4k↓29.8%[8 PRs](https://github.com/alleyinteractive/wp-404-caching/pulls)GPL-2.0-or-laterPHPPHP ^8.2CI passing

Since Mar 22Pushed 1w ago17 watchersCompare

[ Source](https://github.com/alleyinteractive/wp-404-caching)[ Packagist](https://packagist.org/packages/alleyinteractive/wp-404-caching)[ Docs](https://github.com/alleyinteractive/wp-404-caching)[ RSS](/packages/alleyinteractive-wp-404-caching/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (7)Dependencies (3)Versions (25)Used By (0)

WP 404 Caching
==============

[](#wp-404-caching)

[![All Pull Request Tests](https://github.com/alleyinteractive/wp-404-caching/actions/workflows/all-pr-tests.yml/badge.svg?branch=develop)](https://github.com/alleyinteractive/wp-404-caching/actions/workflows/all-pr-tests.yml)

A WordPress plugin to provide full page caching for 404 pages, improving performance and reducing server load.

Requirements
------------

[](#requirements)

- SSL enabled on the website.
- An external object cache setup (e.g., Redis, Memcached).
- Requires at least: 6.3
- Tested up to: 6.4
- Requires PHP: 8.1
- License: GPL v2 or later

Description
-----------

[](#description)

WP 404 Caching is a lightweight plugin that efficiently serves cached 404 pages to non-logged-in users. It reduces server load by storing the cached 404 page in an external object cache and returning it early in the request process.

The plugin uses a dual regular/stale caching strategy to minimize cache misses. It maintains a regular cache with a 1-hour expiration and a stale cache with a 1-day expiration. If the regular cache is empty, the stale cache is served.

Features
--------

[](#features)

- Full page caching for 404 pages
- Utilizes external object cache for storing cached 404 pages
- Dual regular/stale caching strategy to minimize cache misses
- Automatically generates and caches 404 page via a "guaranteed 404 URI"
- Triggers cache generation hourly via a cron job and immediately on cache misses
- Sends `X-WP-404-Cache` header to indicate cache HIT/MISS status
- Ensures compatibility with analytics by replacing the "guaranteed 404 URI" with the actual requested URI in the cached page

Installation
------------

[](#installation)

### Via Composer (recommeded):

[](#via-composer-recommeded)

You can install the package via composer:

```
composer require alleyinteractive/wp-404-caching
```

### Manual install:

[](#manual-install)

1. Upload the `wp-404-caching` directory to your `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.

Usage
-----

[](#usage)

The plugin works out of the box with default settings. You can customize the cache expiration times by modifying the `CACHE_TIME` and `STALE_CACHE_TIME` constants in the `Full_Page_Cache_404` class. Activate the plugin in WordPress and use it like so:

```
add_filter( 'wp_404_caching_cache_time', function( $cache_time ) {
    return 2 * HOUR_IN_SECONDS; // Set cache time to 2 hours.
} );

add_filter( 'wp_404_caching_stale_cache_time', function( $stale_cache_time ) {
    return 2 * DAY_IN_SECONDS; // Set stale cache time to 2 days.
} );

// Programmatically bypass the cache.
add_filter( 'wp_404_caching_enabled', '__return_false' );
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

This project is actively maintained by [Alley Interactive](https://github.com/alleyinteractive). Like what you see? [Come work with us](https://alley.co/careers/).

- [Alley](https://github.com/Alley)

License
-------

[](#license)

The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.

---

Developer Notes
===============

[](#developer-notes)

Testing
-------

[](#testing)

Run `composer test` to run tests against PHPUnit and the PHP code in the plugin.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 56% 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 ~110 days

Recently: every ~138 days

Total

6

Last Release

281d ago

PHP version history (2 changes)v1.0.2PHP ^8.1

v1.2.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![attackant](https://avatars.githubusercontent.com/u/4309872?v=4)](https://github.com/attackant "attackant (47 commits)")[![srtfisher](https://avatars.githubusercontent.com/u/346399?v=4)](https://github.com/srtfisher "srtfisher (21 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![jacobschweitzer](https://avatars.githubusercontent.com/u/3016425?v=4)](https://github.com/jacobschweitzer "jacobschweitzer (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (3 commits)")[![kevinfodness](https://avatars.githubusercontent.com/u/2650828?v=4)](https://github.com/kevinfodness "kevinfodness (1 commits)")

---

Tags

wordpresswordpress-pluginalleyinteractivewp-404-caching

### Embed Badge

![Health badge](/badges/alleyinteractive-wp-404-caching/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-wp-404-caching/health.svg)](https://phpackages.com/packages/alleyinteractive-wp-404-caching)
```

PHPackages © 2026

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