WP Manifestindependent plugin directory
manifest / performance / rwd-cache

RWD Cache

Lightweight reusable page cache for public WordPress HTML pages.

by Mike Rockett · github.com/mikeyeah29/rwd-cache

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/mikeyeah29/rwd-cache/archive/refs/heads/main.zip

RWD Cache is a lightweight page-cache plugin for WordPress. It stores public HTML pages as static files so they can be served without rebuilding the page on every request.

Logged-in users, admin pages, searches, feeds and requests with query strings bypass the cache.

The cache can be enabled, configured and purged under Settings → RWD Cache. It can also be purged with WP-CLI:

wp rwd-cache purge

When a post changes, RWD Cache purges the post URL and the homepage. Use the rwd_cache_post_purge_urls filter to purge any additional pages that depend on that post.

For example, this purges a New Developments listing whenever a new-development post changes:

add_filter(
    'rwd_cache_post_purge_urls',
    function ($urls, $post_id, $post) {
        if ($post instanceof WP_Post && $post->post_type === 'new-development') {
            $urls[] = home_url('/new-developments/');
        }

        return $urls;
    },
    10,
    3
);