Skip to content
Sign in

WP REST Cache

Enable caching of the WordPress REST API and auto-flush caches upon wp-admin editing.

Not scanned yet WordPress plugin 10k installs

Install in

No install steps yet

Follow the steps on the source page.

Are you facing speed issues, using the WordPress REST API? This plugin will allow WordPress to cache the responses of the REST API, making it much faster.

This plugin offers:

  • Caching of all default WordPress REST API GET-endpoints.
  • Caching of (custom) post type endpoints.
  • Caching of (custom) taxonomy endpoints.
  • Automated flushing of caches if (some of) its contents are edited.
  • Manual flushing of all caches.
  • Manual flushing of specific caches.
  • A counter how many times a cache has been retrieved.
  • Specifying after what time the cache should be timed out.
  • Registering custom endpoints for caching.
  • Automatic cache regeneration.

WP REST Cache Pro
For more advanced features, check out our WP REST Cache Pro plugin:

  • Configure custom endpoints for caching through the wp-admin interface.
  • Configure relationships within endpoints.
  • No coding required.

Installation from within WordPress

  1. Visit ‘Plugins > Add New’ (or ‘My Sites > Network Admin > Plugins > Add New’ if you are on a multisite installation).
  2. Search for ‘WP REST Cache’.
  3. Activate the WP REST Cache plugin through the ‘Plugins’ menu in WordPress.
  4. Go to “after activation” below.

Installation manually

  1. Upload the wp-rest-cache folder to the /wp-content/plugins/ directory.
  2. Activate the WP REST Cache plugin through the ‘Plugins’ menu in WordPress.
  3. Go to “after activation” below.

After activation

  1. Visit ‘Plugins > Must-Use’ (or ‘My Sites > Network Admin > Plugins > Must-Use’ if you are on a multisite installation).
  2. Check if the ‘WP REST Cache – Must-Use Plugin’ is there, if not copy the file wp-rest-cache.php from the /sources folder of the WP REST Cache Plugin to the folder /wp-content/mu-plugins/.

Optionally:
The default timeout for caches generated by the WP REST Cache plugin is set to 1 year. If you want to change this:

  1. Visit ‘Settings > WP REST Cache’.
  2. Change the Cache timeout.

Written by Joobi from the project's own listing. See the source page

apicacheRESTrest cachewp-rest-api
23 Nov 2026
Version 2026.4.3 released. Not scanned yet.

2026.4.3

Release Date: November 23rd, 2026

Security: Unauthenticated visitors could poison the cache by sending a GET request with a request body (e.g. a JSON body) or a method override (_method parameter or X-HTTP-Method-Override header). WordPress core uses these to generate the response, but they were not part of the cache key, so the response was served to all visitors of that URL. It was reported by Kang MinSeok (AhnLab) through Patchstack. All existing caches are flushed on update.
Backwards compatibility: GET and HEAD requests with a request body, and requests with a method override, are no longer cached. For other request methods that are allowed to be cached (setting “Allowed request methods”) the request body is now part of the cache key, so requests with a different body no longer share a cache. The cache key of requests without a body is unchanged. The Endpoint_Api::save_cache() method now accepts the optional $server and $request arguments of the rest_pre_echo_response filter.
Feature: Added filter wp_rest_cache/skip_get_request_with_body to allow caching of GET and HEAD requests with a request body (cached per body).

2026.4.2

Release Date: October 29th, 2026

Fix: Caches that expired, or that were flushed and cleaned up, were never removed from the database, causing the caches table to grow indefinitely. A daily cron job now removes them (unless cache regeneration is enabled). It was reported by krstarica.
Improvement: The cache regeneration cron no longer loads the entire caches table into memory.
Feature: Added filters wp_rest_cache/purge_stale_caches, wp_rest_cache/stale_cache_grace_period and wp_rest_cache/max_purge_caches.

2026.4.1

Release Date: October 29th, 2026

Fix: Deleted caches that had been flushed and cleaned up before were never removed from the database, causing the caches table to grow indefinitely. Existing leftover caches are removed by the cleanup cron. It was reported by krstarica.

2026.4.0

Release Date: October 27th, 2026

Security: Responses generated for authenticated users (e.g. through Application Passwords or Basic auth) could be cached and served to unauthenticated visitors. Requests with an Authorization header and requests with context=edit are no longer cached, responses for authenticated users are only cached if the cache key is user specific, and nonce cached requests are now cached per session. All existing caches are flushed on update.
Feature: Added filter wp_rest_cache/cache_authenticated_response to allow caching of responses generated for authenticated users when the cache key is made user specific.

2026.3.1

Release Date: July 25th, 2026

Improvement: Make the mu-plugin use the same version as the main plugin.

2026.3.0

Release Date: July 24th, 2026

Fix: several small fixes and improvements.
Improvement: Add support for using regex inside wp_rest_cache/allowed_endpoints and wp_rest_cache/disallowed_endpoints filters.

2026.2.0

Release Date: May 19th, 2026

Fix: specified key was too long error.
Improvement: Extra filters and actions.

2026.1.3

Release Date: March 3rd, 2026

Fix: Prevent performance issue with hierarchical categories.

2026.1.2

Release Date: February 25th, 2026

Fix: Prevent PHP warnings.
Improvement: Add filter to disallow skip_cache parameter.
Improvement: Added error log if set_transient fails.
Improvement: Add support for flushing term cache when objects terms are modified. (Contribution by: Moshe Gross)

2026.1.1

Release Date: January 20th, 2026

Fix: A XSS vulnerability in the plugin was discovered and fixed. It was reported by Nguyen Ba Khanh.
Fix: Improved transition_post_status_logic. (Contribution by: Moshe Gross)

2026.1.0

Release Date: January 14th, 2026

Improvement: Only flush caches on meta update if filter returns true.

2025.2.0

Release Date: December 15th, 2025

Improvement: Also flush caches when only the (post) meta is updated.

Earlier versions

For the changelog of earlier versions, please refer to the changelog on Github.

31 Jan 2019Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)