{"id":412170,"date":"2026-11-25T10:14:22","date_gmt":"2026-11-25T10:14:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/rockfire-rest-api-cache\/"},"modified":"2026-11-25T10:47:01","modified_gmt":"2026-11-25T10:47:01","slug":"rockfire-rest-api-cache","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/rockfire-rest-api-cache\/","author":8572554,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.5","requires":"6.6","requires_php":"8.1","requires_plugins":null,"header_name":"Rockfire \u2013 REST API Cache","header_author":"Rockfire","header_description":"Fast, security-hardened caching for the WordPress REST API.","last_updated":"2026-11-25 10:47:01","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/profiles.wordpress.org\/rockfire\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":25,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"rockfire","date":"2026-11-25 10:47:01","revision":3822586}},"upgrade_notice":{"1.0.0":"<p>First public release: there is no earlier version of this plugin to upgrade from. Moving over from WP REST Cache is covered in the FAQ.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3822512,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3822512,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3822512,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3822512,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3822512,"resolution":"1","location":"assets","locale":"","width":1280,"height":800},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3822512,"resolution":"2","location":"assets","locale":"","width":1280,"height":800},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3822512,"resolution":"3","location":"assets","locale":"","width":1280,"height":800},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3822512,"resolution":"4","location":"assets","locale":"","width":1280,"height":800},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3822512,"resolution":"5","location":"assets","locale":"","width":1280,"height":800}},"screenshots":{"1":"Caches: the cached REST API responses with their method, route, state, size, hits and expiry, ready to flush or delete.","2":"Routes: every registered REST route with its namespace, caching status, TTL and parameters.","3":"A route's edit view: its status, the methods it caches and its parameters.","4":"Settings: defaults and request rules.","5":"Tools: the status of the must-use file and the cache, and flushing by tag, URL or route."}},"plugin_section":[],"plugin_tags":[1556,146,141196,247,23853],"plugin_category":[52,54],"plugin_contributors":[167407],"plugin_business_model":[],"class_list":["post-412170","plugin","type-plugin","status-publish","hentry","plugin_tags-api","plugin_tags-cache","plugin_tags-headless","plugin_tags-performance","plugin_tags-rest-api","plugin_category-performance","plugin_category-security-and-spam-protection","plugin_contributors-rockfire","plugin_committers-rockfire"],"banners":{"banner":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/banner-772x250.png?rev=3822512","banner_2x":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/banner-1544x500.png?rev=3822512","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/icon-128x128.png?rev=3822512","icon_2x":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/icon-256x256.png?rev=3822512","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/screenshot-1.png?rev=3822512","caption":"Caches: the cached REST API responses with their method, route, state, size, hits and expiry, ready to flush or delete."},{"src":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/screenshot-2.png?rev=3822512","caption":"Routes: every registered REST route with its namespace, caching status, TTL and parameters."},{"src":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/screenshot-3.png?rev=3822512","caption":"A route's edit view: its status, the methods it caches and its parameters."},{"src":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/screenshot-4.png?rev=3822512","caption":"Settings: defaults and request rules."},{"src":"https:\/\/ps.w.org\/rockfire-rest-api-cache\/assets\/screenshot-5.png?rev=3822512","caption":"Tools: the status of the must-use file and the cache, and flushing by tag, URL or route."}],"raw_content":"<!--section=description-->\n<p>Rockfire \u2013 REST API Cache stores the JSON responses of the WordPress REST API and serves repeated anonymous <code>GET<\/code> requests from the cache, before most of WordPress has loaded. Cached responses are flushed when the content they contain changes, so headless front ends, apps and decoupled sites get fast responses without stale data.<\/p>\n\n<p><strong>Features<\/strong><\/p>\n\n<ul>\n<li><strong>Early serving.<\/strong> A small must-use file serves cache hits before regular plugins and the theme load. Without it the plugin still works in fallback mode and serves hits from <code>plugins_loaded<\/code>.<\/li>\n<li><strong>Route manager.<\/strong> Every readable <code>wp\/v2<\/code> route and the oEmbed route are cached by default. Under REST API Cache \u2192 Routes you enable or exclude any registered route (or a wildcard family of routes) and set its TTL, accepted parameters, ignored and bypass parameters, vary headers, and the post types and taxonomies whose changes flush it. Routes that only have <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code> handlers are listed too, and a route can opt in to caching the <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code> methods it registers (never on <code>wp\/v2<\/code>).<\/li>\n<li><strong>Tag-based invalidation.<\/strong> Every cached response is tagged with the posts, terms, users, comments and lists it contains. Saving, trashing or deleting content, and changing terms, REST-exposed meta, users, comments or relevant options flushes the responses carrying those tags. A post response only refers to its terms, so adding another post to one of its categories or removing one from it, and renaming or describing a category, flush the category's own responses but not the other posts in it. A post response is flushed when its own terms change, or when one of its terms is deleted or gets a new slug or parent.<\/li>\n<li><strong>Public PHP API.<\/strong> Flush by tag, URL, route or everything, and add your own tags to responses: <code>rfrac_flush_tag()<\/code>, <code>rfrac_flush_url()<\/code>, <code>rfrac_flush_route()<\/code>, <code>rfrac_flush_all()<\/code> and <code>rfrac_tag_response()<\/code>.<\/li>\n<li><strong>Pruning and limits.<\/strong> An hourly maintenance run deletes flushed and expired entries and evicts the least recently used entries above the entry limit. The payload size, the number of query parameters, the query length and the number of tags per entry are limited.<\/li>\n<li><strong>Object-cache store.<\/strong> With a persistent object cache the payloads are served from the object cache, so the plugin looks up and serves a hit without querying its database tables.<\/li>\n<li><strong>WP-CLI.<\/strong> <code>wp rfrac flush<\/code>, <code>wp rfrac list<\/code>, <code>wp rfrac status<\/code>, <code>wp rfrac prune<\/code> and <code>wp rfrac config get<\/code>.<\/li>\n<li><strong>Multisite.<\/strong> Per-site tables and settings, network activation, automatic setup of new sites and <code>--network<\/code> options in WP-CLI.<\/li>\n<li><strong>WooCommerce.<\/strong> With WooCommerce active, the public Store API catalog (products, categories, brands, tags, attributes and reviews) can be cached once you enable it under REST API Cache \u2192 Routes. The cart, checkout, orders and every logged-in shopper are never cached.<\/li>\n<li><strong>Admin screens and Site Health.<\/strong> Browse and flush cached responses, manage routes and settings, check the must-use file and run maintenance from the REST API Cache menu; Site Health reports problems.<\/li>\n<\/ul>\n\n<p><strong>What is never cached<\/strong><\/p>\n\n<p>Requests from logged-in users; requests with an <code>Authorization<\/code> header, a nonce (the <code>X-WP-Nonce<\/code> header or a <code>_wpnonce<\/code> parameter, unless the <code>rfrac\/nonce_caching<\/code> filter lets a logged-out request that only carries a nonce be cached), an API key header or a login, session or post password cookie (a login cookie is never cached, whatever the filters say); requests with a method the route is not opted in to (only <code>GET<\/code>, unless the route opts in to <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code>); requests with an <code>X-HTTP-Method-Override<\/code> header; GET requests that carry a body; requests with a multipart, invalid or oversized body, or a body that is neither JSON nor a URL-encoded form; a <code>context<\/code> other than <code>view<\/code> or <code>embed<\/code>; <code>status<\/code> queries other than <code>publish<\/code>; requests with a response format parameter (<code>_jsonp<\/code>, <code>_envelope<\/code>, <code>_pretty<\/code> or <code>_method<\/code>); the routes on the hard deny-list (<code>\/wp\/v2\/users\/me<\/code>, <code>\/batch\/v1<\/code>, the WooCommerce Store API cart, checkout, order, batch and shopper-list routes, and the WooCommerce <code>wc\/agentic<\/code> and <code>wc\/private<\/code> routes); requests over the limits (a route longer than 191 bytes, a query string longer than 2048 bytes, more query parameters than the configured maximum, or a route or parameter that is not valid UTF-8; the route is checked as sent, so a percent-encoded byte such as <code>%FF<\/code> in the path is plain ASCII); and responses that are not <code>200 OK<\/code>, are empty result sets, are larger than the payload limit, carry more tags than the tag limit, set a cookie, are marked <code>private<\/code>, <code>no-store<\/code>, <code>no-cache<\/code> or <code>max-age=0<\/code>, or are vetoed by the <code>rfrac\/store_allowed<\/code> filter. No new responses are stored while the cache holds about 1.5 times the entry limit, until maintenance has pruned it.<\/p>\n\n<h4>Credits<\/h4>\n\n<p>Rockfire \u2013 REST API Cache is a fork of WP REST Cache by Acato (https:\/\/wordpress.org\/plugins\/wp-rest-cache\/), GPLv3.<\/p>\n\n<h4>Significant changes from WP REST Cache<\/h4>\n\n<ul>\n<li>Security fixes: responses are never cached for authenticated requests (logged-in users, <code>Authorization<\/code>, nonces unless the <code>rfrac\/nonce_caching<\/code> filter lets a logged-out request that only carries a nonce be cached, credential headers and cookies; a login cookie always bypasses); routes are matched strictly against the registered routes; the cache key is built from the parameters a route knows, and unknown parameters bypass the cache instead of creating new entries; sizes and counts are limited; the plugin makes no outbound HTTP requests and stores no credentials; only an allow-list of response headers is replayed.<\/li>\n<li>A new architecture and database schema (<code>rfrac_entries<\/code> and <code>rfrac_tags<\/code>), a compiled configuration that the early phase reads without loading other plugins, and a database or object-cache store.<\/li>\n<li>A route manager instead of a list of allowed endpoints.<\/li>\n<li>Tag-based invalidation instead of object-type relations, with a public PHP API.<\/li>\n<li>Pruning and size limits keep the cache tables bounded.<\/li>\n<li>The <code>wp rfrac<\/code> WP-CLI commands.<\/li>\n<li>Full multisite support.<\/li>\n<li>A real uninstall that removes every table, option, transient, user meta key, cron event and the must-use file.<\/li>\n<li>The cache regeneration cron and the upsell have been removed.<\/li>\n<\/ul>\n\n<h4>Must-use file<\/h4>\n\n<p><strong>What:<\/strong> the plugin installs <code>wp-content\/mu-plugins\/rfrac-early-cache.php<\/code> (in the must-use plugins directory, <code>WPMU_PLUGIN_DIR<\/code>). It is a small loader that does nothing unless this plugin is active.<\/p>\n\n<p><strong>Why:<\/strong> must-use plugins load before regular plugins, so a cache hit is served before other plugins and the theme are loaded. That is what makes a hit fast.<\/p>\n\n<p><strong>When it is written:<\/strong> at exactly three moments. On activation (on multisite only when the activating user may manage network plugins, <code>manage_network_plugins<\/code>; an activation by a site administrator or from WP-CLI does not write it). When someone clicks the \"Install must-use file\" button (a user who may manage plugins, <code>activate_plugins<\/code>; on multisite <code>manage_network_plugins<\/code>, because the file is shared by the whole network). And when this plugin is updated, by any updater (including automatic updates), while an outdated copy built from the plugin's template (it carries an <code>RFRAC Template:<\/code> header) already exists: that copy is refreshed. An update never creates a missing file and never touches a file that is not built from the template. Nothing else writes the file. It is written atomically: a temporary file is written, verified and renamed into place, and the plugin never asks for FTP credentials.<\/p>\n\n<p><strong>Notice:<\/strong> when the file is missing or outdated, a notice with an \"Install must-use file\" button appears on the Plugins screen and on the plugin's own pages for a user who may install it, and the plugin serves cache hits from <code>plugins_loaded<\/code> (fallback mode) until it is installed.<\/p>\n\n<p><strong>When it is removed:<\/strong> on deactivation, unless the plugin is still active on another site of the network, and on uninstall.<\/p>\n\n<p><strong>Fallback mode:<\/strong> when the file cannot be written (the directory is not writable, WordPress cannot write files directly, or <code>DISALLOW_FILE_MODS<\/code> is set) the plugin keeps working and serves cache hits from <code>plugins_loaded<\/code>. REST API Cache \u2192 Tools and Site Health show the mode and the reason.<\/p>\n\n<p><strong>Manual install:<\/strong> copy <code>wp-content\/plugins\/rockfire-rest-api-cache\/mu-plugin\/rfrac-early-cache.php<\/code> to <code>wp-content\/mu-plugins\/rfrac-early-cache.php<\/code>, then in the copy replace <code>{{RFRAC_PLUGIN_VERSION}}<\/code> with the plugin version and <code>{{RFRAC_PLUGIN_BASENAME}}<\/code> with <code>rockfire-rest-api-cache\/rockfire-rest-api-cache.php<\/code>. REST API Cache \u2192 Tools shows the exact values for your site.<\/p>\n\n<p><strong>Opting out:<\/strong> add <code>define( 'RFRAC_DISABLE_MU_INSTALL', true );<\/code> to <code>wp-config.php<\/code> and the plugin never writes the file.<\/p>\n\n<h4>Privacy<\/h4>\n\n<p>The plugin does not track users, does not send data to external services and makes no external HTTP requests. It only caches public REST API responses: requests carrying credentials are never cached. All cached data is stored in your own database (or object cache) and is removed when the plugin is uninstalled.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install the plugin from Plugins \u2192 Add New, or upload the <code>rockfire-rest-api-cache<\/code> folder to <code>wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin (network-activate it on multisite to cache every site). Activation creates the cache tables and installs the must-use file.<\/li>\n<li>If the must-use file is missing or outdated, a notice on the Plugins screen and on the plugin's pages offers an \"Install must-use file\" button. Open REST API Cache \u2192 Tools to check that the file is installed and serving early; if it cannot be written, follow the manual install instructions shown there.<\/li>\n<li>Review REST API Cache \u2192 Routes: the <code>wp\/v2<\/code> routes and the oEmbed route are cached by default; enable the routes of other plugins you want to cache.<\/li>\n<li>Optionally adjust REST API Cache \u2192 Settings (default and maximum TTL, entry limit, payload size, store).<\/li>\n<\/ol>\n\n<p>Do not run this plugin together with WP REST Cache: deactivate WP REST Cache first.<\/p>\n\n<p><strong>Configuration constants<\/strong> (in <code>wp-config.php<\/code>; a constant locks the matching setting in the admin):<\/p>\n\n<ul>\n<li><code>RFRAC_DISABLE<\/code> \u2013 <code>true<\/code> disables caching immediately (kill switch).<\/li>\n<li><code>RFRAC_STORE<\/code> \u2013 <code>auto<\/code> (default: the object cache when a persistent object cache is available, else the database), <code>database<\/code> or <code>object_cache<\/code>.<\/li>\n<li><code>RFRAC_DEFAULT_TTL<\/code> \u2013 default time to live in seconds (default 86400).<\/li>\n<li><code>RFRAC_MAX_TTL<\/code> \u2013 maximum time to live in seconds (default 2592000).<\/li>\n<li><code>RFRAC_MAX_ENTRIES<\/code> \u2013 maximum number of cached responses per site (default 10000).<\/li>\n<li><code>RFRAC_MAX_PAYLOAD_KB<\/code> \u2013 largest response stored, in KB (default 1024).<\/li>\n<li><code>RFRAC_MAX_PARAMS<\/code> \u2013 maximum number of query parameters of a cached request (default 20).<\/li>\n<li><code>RFRAC_HIT_SAMPLING<\/code> \u2013 count one hit in N for the statistics; 0 disables hit counting (default 10).<\/li>\n<li><code>RFRAC_GLOBAL_IGNORE_PARAMS<\/code> \u2013 query parameters that never change the cache key on any route, for example <code>define( 'RFRAC_GLOBAL_IGNORE_PARAMS', array( 'utm_source', 'fbclid' ) );<\/code> (an array, or one string separated by commas or spaces; at most 20 names of letters, digits and <code>_-.[]<\/code>). The constant locks the setting under REST API Cache \u2192 Settings, and the <code>rfrac\/global_ignore_params<\/code> filter still applies on top of it. A parameter a route registers is never ignored on that route. A value that is not valid (a bad name or too many names) is ignored and reported; <code>array()<\/code> locks the list to empty.<\/li>\n<li><code>RFRAC_GLOBAL_VARY_HEADERS<\/code> \u2013 request headers that vary the cache key on every route, for example <code>define( 'RFRAC_GLOBAL_VARY_HEADERS', array( 'Accept-Language' ) );<\/code> (an array, or one string separated by commas or spaces; names are lowercased and an underscore counts as a dash). At most 5 headers together with the vary headers of each route; <code>Authorization<\/code>, <code>Cookie<\/code>, <code>Set-Cookie<\/code>, <code>Proxy-Authorization<\/code> and <code>X-WP-Nonce<\/code> are not allowed. The constant locks the setting, and the <code>rfrac\/global_vary_headers<\/code> filter still applies on top of it. Unlike the other constants, a value that is not valid is not set aside for the stored setting: it is reported, and no route is cached until it is fixed, because caching with a different list would serve one shared response to visitors who should get their own.<\/li>\n<li><code>RFRAC_NONCE_CACHING<\/code> \u2013 whether a logged-out request that only carries a REST nonce (the <code>X-WP-Nonce<\/code> header or a <code>_wpnonce<\/code> parameter) may be cached (default false), for example <code>define( 'RFRAC_NONCE_CACHING', true );<\/code>. A cache hit never verifies the nonce, and every other credential signal and every login cookie still bypasses. The constant locks the Cache requests with a REST nonce setting under REST API Cache \u2192 Settings, and the <code>rfrac\/nonce_caching<\/code> filter still applies on top of it. A value that is not a boolean is ignored and reported as the plugin's last error.<\/li>\n<li><code>RFRAC_ROUTES<\/code> \u2013 route rules defined in code, keyed by route, for example <code>define( 'RFRAC_ROUTES', array( '\/my\/v1\/header' =&gt; array( 'status' =&gt; 'enabled', 'ttl' =&gt; 3600 ) ) );<\/code>. A rule can also list the request <code>methods<\/code> it caches, for example <code>'methods' =&gt; array( 'GET', 'POST' )<\/code> (<code>GET<\/code> when absent; <code>POST<\/code>, <code>PUT<\/code> and <code>PATCH<\/code> only for methods the route registers, never on <code>wp\/v2<\/code>; see \"Can I cache POST, PUT or PATCH requests?\"). These routes are read-only in the admin.<\/li>\n<li><code>RFRAC_ALLOW_SKIP_CACHE<\/code> \u2013 whether the <code>skip_cache<\/code> request parameter bypasses the cache (default false).<\/li>\n<li><code>RFRAC_BYPASS_COOKIES<\/code> \u2013 extra cookie name prefixes that bypass the cache (array). Entries that are not valid cookie name characters (letters, digits and the other cookie name characters such as <code>-<\/code>, <code>_<\/code>, <code>.<\/code> and <code>!<\/code>, but not <code>%<\/code>; at most 128) are ignored and reported as the plugin's last error; a <code>.<\/code> matches <code>_<\/code>, the name PHP gives the cookie.<\/li>\n<li><code>RFRAC_BYPASS_HEADERS<\/code> \u2013 extra request headers that carry credentials and bypass the cache (array). Entries that are not header names (letters, digits, dashes and underscores, at most 64; an underscore counts as a dash, as PHP can not tell them apart) are ignored and reported as the plugin's last error.<\/li>\n<li><code>RFRAC_CORS_WILDCARD<\/code> \u2013 send <code>Access-Control-Allow-Origin: *<\/code> on cache hits for origins that are not allowed.<\/li>\n<li><code>RFRAC_DISABLE_MU_INSTALL<\/code> \u2013 never write the must-use file.<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt id=\"why%20isn%27t%20my%20endpoint%20cached%3F\"><h3>Why isn't my endpoint cached?<\/h3><\/dt>\n<dd><p>REST API <code>GET<\/code> responses, and the <code>POST<\/code>, <code>PUT<\/code> and <code>PATCH<\/code> responses of routes that opted in to those methods, carry an <code>X-Rfrac-Cache<\/code> header: <code>HIT<\/code> (served from the cache), <code>MISS<\/code> (generated by WordPress and stored in the cache) or <code>BYPASS<\/code> (not served from the cache and not stored). With <code>WP_DEBUG<\/code> enabled, a bypassed response also carries <code>X-Rfrac-Cache-Reason<\/code>, for example:<\/p>\n\n<ul>\n<li><code>route_not_enabled<\/code> \u2013 enable the route under REST API Cache \u2192 Routes.<\/li>\n<li><code>unknown_param<\/code> \u2013 the request uses a query parameter the route does not register. Add it to the route's ignored parameters, to REST API Cache \u2192 Settings \u2192 Ignored query parameters to ignore it on every route, or let the route accept all parameters.<\/li>\n<li><code>credentials<\/code> \u2013 the request is authenticated or carries a bypass cookie or header, or a <code>password<\/code> parameter.<\/li>\n<li><code>context<\/code> or <code>status_param<\/code> \u2013 the request asks for non-public data.<\/li>\n<li><code>denied_route<\/code> \u2013 the route is on the hard deny-list and is never cached.<\/li>\n<li><code>method<\/code>, <code>method_override<\/code> or <code>body<\/code> \u2013 the route is not opted in to the request method (only <code>GET<\/code>, unless the route opts in to <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code>), the request carries an <code>X-HTTP-Method-Override<\/code> header, it is a <code>GET<\/code> request with any body, or its body is multipart, neither JSON nor a URL-encoded form, invalid, or larger than 64 KB.<\/li>\n<li><code>format_param<\/code> \u2013 the request uses <code>_jsonp<\/code>, <code>_envelope<\/code>, <code>_pretty<\/code> or <code>_method<\/code>.<\/li>\n<li><code>bypass_param<\/code> \u2013 the request uses one of the route's bypass parameters.<\/li>\n<li><code>visitor_varies<\/code> \u2013 another plugin makes this route's responses vary per visitor (e.g. WooCommerce prices with a tax-location plugin), so it is never cached.<\/li>\n<li><code>vary_cookie<\/code> \u2013 a declared cookie carries a value outside its allow-list.<\/li>\n<li><code>skip_cache<\/code> \u2013 the request uses <code>skip_cache<\/code> and skipping is allowed (<code>RFRAC_ALLOW_SKIP_CACHE<\/code> or the <code>rfrac\/allow_skip_cache<\/code> filter).<\/li>\n<li><code>too_many_params<\/code> or <code>query_too_long<\/code> \u2013 more query parameters than the configured maximum, or a query string longer than 2048 bytes.<\/li>\n<li><code>coexistence<\/code> \u2013 WP REST Cache is active; deactivate it.<\/li>\n<li><code>disabled<\/code> \u2013 caching is turned off in the settings or by <code>RFRAC_DISABLE<\/code>.<\/li>\n<\/ul>\n\n<p>A cacheable request whose response is not stored is marked <code>BYPASS<\/code> too, with the reason the response was not stored:<\/p>\n\n<ul>\n<li><code>status<\/code> \u2013 the response is not <code>200 OK<\/code>.<\/li>\n<li><code>empty<\/code> \u2013 the response is an empty result set (see the <code>rfrac\/cache_empty_results<\/code> filter).<\/li>\n<li><code>too_large<\/code> \u2013 the response is larger than the payload limit.<\/li>\n<li><code>set_cookie<\/code> or <code>private<\/code> \u2013 the response sets a cookie, or is marked <code>private<\/code>, <code>no-store<\/code>, <code>no-cache<\/code> or <code>max-age=0<\/code>.<\/li>\n<li><code>user<\/code> \u2013 a user was logged in while the response was generated.<\/li>\n<li><code>too_many_tags<\/code> \u2013 the response carries more tags than the tag limit.<\/li>\n<li><code>entry_ceiling<\/code> \u2013 the cache already holds 1.5 times the entry limit (the count includes responses stored moments ago and is recounted as it nears that ceiling); maintenance prunes it back to the limit.<\/li>\n<li><code>vary_cookie<\/code> \u2013 a cookie declaration changed since the configuration was compiled; the next recompile fixes it.<\/li>\n<li><code>filtered<\/code> \u2013 the <code>rfrac\/store_allowed<\/code> filter vetoed storing, a <code>wp_rest_cache\/cache_key<\/code> or <code>wp_rest_cache\/filter_cache_output<\/code> callback is hooked while <code>RFRAC_LEGACY_HIT_FILTERS<\/code> is not defined, or the <code>rfrac\/bypass_all<\/code> filter bypassed every request.<\/li>\n<li><code>flushed<\/code> \u2013 the cache was flushed after this request looked it up (for example, content was taken down while the response was being generated); the next request stores it again.<\/li>\n<li><code>no_lookup<\/code> \u2013 no lookup recorded a starting point for this request (which is how a flush in between is detected), for example on the first request after the plugin was updated, before its configuration was rebuilt; the next request normally stores it.<\/li>\n<li><code>disabled<\/code> \u2013 caching was turned off (<code>RFRAC_DISABLE<\/code>) while the response was being generated.<\/li>\n<li><code>error<\/code> \u2013 storing failed, or the tags of the response could not be collected completely; the error is shown on the plugin's admin pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"can%20i%20cache%20post%2C%20put%20or%20patch%20requests%3F\"><h3>Can I cache POST, PUT or PATCH requests?<\/h3><\/dt>\n<dd><p>Yes, for front ends that read data with a <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code> request (a search or filter endpoint, for example). It is an opt-in per route, and <code>GET<\/code> stays the only method cached everywhere else:<\/p>\n\n<ul>\n<li>Under REST API Cache \u2192 Routes, edit the route and tick the methods to cache, or set <code>'methods'<\/code> in a rule (<code>RFRAC_ROUTES<\/code>). Only methods the route registers a handler for can be chosen, and the route has to be enabled. Routes that only have <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code> handlers are listed too.<\/li>\n<li>Never on <code>wp\/v2<\/code>: core routes are only cached for <code>GET<\/code>. <code>DELETE<\/code> is never cached, and the deny-list and the credential checks apply to every method.<\/li>\n<li>The cache key adds the method, the content type and a hash of the request body. <code>application\/json<\/code> and <code>application\/x-www-form-urlencoded<\/code> bodies are decoded and canonicalised first, so the order of the keys and the whitespace do not split the cache. Only the hash is stored, never the body.<\/li>\n<li>A body larger than 64 KiB, a <code>multipart<\/code> body, a body that is not valid JSON or UTF-8, and any request with an <code>X-HTTP-Method-Override<\/code> header bypass the cache.<\/li>\n<li>A <code>GET<\/code> with a body is never cached.<\/li>\n<\/ul>\n\n<p>Warning: a cached <code>POST<\/code>, <code>PUT<\/code> or <code>PATCH<\/code> response is served without running the route's handler, so anything the handler does besides returning data (saving, sending, counting) does not happen on a cache hit. Enable these methods only for routes that only read data. The route editor repeats this warning next to the method checkboxes.<\/p><\/dd>\n<dt id=\"how%20do%20i%20flush%20the%20cache%20from%20code%3F\"><h3>How do I flush the cache from code?<\/h3><\/dt>\n<dd><p>Use the public API. Every flush function returns the number of flushed responses and acts on the current site:<\/p>\n\n<pre><code>rfrac_flush_tag( 'post:12' );                    \/\/ Everything that contains post 12.\nrfrac_flush_tag( array( 'post:12', 'list:product' ) );\nrfrac_flush_url( rest_url( 'wp\/v2\/posts' ) );    \/\/ One URL, including its query string.\nrfrac_flush_route( '\/wp\/v2\/posts' );             \/\/ A route and everything below it.\nrfrac_flush_all();                               \/\/ Everything of the current site.\n<\/code><\/pre>\n\n<p>Tags have the form <code>prefix:value<\/code>: <code>post:{id}<\/code>, <code>term:{id}<\/code>, <code>term-ref:{id}<\/code>, <code>user:{id}<\/code>, <code>comment:{id}<\/code>, <code>list:{post type or taxonomy}<\/code>, <code>list:users<\/code>, <code>list:comments<\/code>, or your own prefix. <code>term:{id}<\/code> marks responses that show a term (the term itself, term lists, embedded terms) and is flushed when the term changes; <code>term-ref:{id}<\/code> marks responses that only refer to the term, like a post with its <code>categories<\/code>, <code>class_list<\/code> and link, and is flushed only when the term is deleted or its slug or parent changes (for the term and its descendants). A value has no spaces or commas, so several tags can also be passed as one string separated by commas or spaces (<code>'post:12, list:product'<\/code>). Tag your own responses while they are generated, for example in a route callback, and flush them later:<\/p>\n\n<pre><code>rfrac_tag_response( 'acf-options:header' );\n\/\/ ... later, after the options were saved:\nrfrac_flush_tag( 'acf-options:header' );\n<\/code><\/pre>\n\n<p>Call these functions from <code>plugins_loaded<\/code> or later. A custom route such as <code>\/my\/v1\/header<\/code> is only cached once you enable it under REST API Cache \u2192 Routes or in <code>RFRAC_ROUTES<\/code>: by default only the <code>wp\/v2<\/code> routes and the oEmbed route are cached.<\/p>\n\n<p>With WooCommerce active, the tags of its public Store API responses are <code>wc-price:all<\/code>, <code>wc-attribute:{id}<\/code>, <code>list:wc-attribute<\/code>, <code>list:wc-review<\/code> and <code>list:wc-popularity<\/code> (carried by product lists sorted by popularity and flushed when a product's sales count changes), plus the tags above that WooCommerce objects reuse: <code>post:{id}<\/code>, <code>term:{id}<\/code>, <code>list:product<\/code>, <code>list:product_cat<\/code>, <code>list:product_tag<\/code>, <code>list:product_brand<\/code> and <code>list:pa_{attribute}<\/code> (for example <code>list:pa_color<\/code>). Flush them like any other tag. Changes to the location of a tax rate made by calling WooCommerce's internal <code>WC_Tax::_update_tax_rate_postcodes()<\/code> or <code>WC_Tax::_update_tax_rate_cities()<\/code> directly are not detected: code that does this should flush the <code>wc-price:all<\/code> tag afterwards, for example <code>rfrac_flush_tag( 'wc-price:all' )<\/code>.<\/p><\/dd>\n<dt id=\"which%20hooks%20exist%3F\"><h3>Which hooks exist?<\/h3><\/dt>\n<dd><p>Actions to react to flushes, stores, failures, maintenance and the plugin lifecycle, such as <code>rfrac\/flushed<\/code> (purge a CDN after a flush) and <code>rfrac\/stored<\/code>. Filters to change routes, bypass rules, cache keys, tags, invalidation and admin access, such as <code>rfrac\/route_rules<\/code>, <code>rfrac\/bypass_headers<\/code>, <code>rfrac\/entry_ttl<\/code>, <code>rfrac\/store_allowed<\/code> and <code>rfrac\/settings_capability<\/code>. Filters that are compiled into the configuration apply after the next recompile, such as a settings save.<\/p>\n\n<p>Every hook, with its parameters and examples, is in the hooks reference at https:\/\/rockfire.nl\/docs\/hooks\/ and in <code>includes\/class-hooks.php<\/code>.<\/p><\/dd>\n<dt id=\"which%20wp-cli%20commands%20are%20available%3F\"><h3>Which WP-CLI commands are available?<\/h3><\/dt>\n<dd><ul>\n<li><code>wp rfrac flush --all<\/code>, <code>wp rfrac flush --tag=post:1,post:2<\/code>, <code>wp rfrac flush --route=\/wp\/v2\/posts<\/code> and <code>wp rfrac flush --request-url=https:\/\/example.com\/wp-json\/wp\/v2\/posts<\/code> \u2013 flush cached responses. The URL option is named <code>--request-url<\/code> because WP-CLI reserves <code>--url<\/code> for selecting the site.<\/li>\n<li><code>wp rfrac list<\/code> \u2013 list cached responses; filter and format with <code>--route<\/code>, <code>--state<\/code>, <code>--search<\/code>, <code>--per-page<\/code>, <code>--page<\/code>, <code>--fields<\/code> and <code>--format<\/code>.<\/li>\n<li><code>wp rfrac status<\/code> \u2013 show the cache status, including whether the must-use file serves early.<\/li>\n<li><code>wp rfrac prune<\/code> \u2013 run one maintenance pass.<\/li>\n<li><code>wp rfrac config get<\/code> \u2013 show the effective settings and where each value comes from; <code>--compiled<\/code> prints the compiled configuration.<\/li>\n<li><code>wp rfrac import-legacy<\/code> \u2013 import the settings of WP REST Cache and report what became of every value. <code>wp rfrac import-legacy --dry-run<\/code> prints what would happen and saves nothing; <code>--format<\/code> picks the output. The steps are described under \"How do I switch from WP REST Cache?\" below.<\/li>\n<\/ul>\n\n<p>On multisite, <code>wp rfrac flush<\/code>, <code>wp rfrac list<\/code> and <code>wp rfrac prune<\/code> accept <code>--network<\/code> to act on every site where the plugin is active. <code>wp rfrac import-legacy --dry-run --network<\/code> does the same for the import, in one WP-CLI process per site, so that each site loads its own plugins.<\/p><\/dd>\n<dt id=\"why%20does%20a%20notice%20appear%20after%20i%20switch%20a%20plugin%20on%20or%20off%3F\"><h3>Why does a notice appear after I switch a plugin on or off?<\/h3><\/dt>\n<dd><p>A plugin can change what the REST API returns, so after any other plugin is activated or deactivated (from the admin, by AJAX or with WP-CLI) the cached responses of the site may be outdated. The plugin does not flush by itself: it shows a notice on the Plugins screen and on the plugin's own admin pages, to users who may manage the plugin, with two buttons. Flush all clears the cached responses of the site, and the notice goes away with any full flush. Dismiss hides the notice and keeps the cache as it is. On multisite, a network-wide change shows the notice on every site when the plugin is network-active; otherwise only on the site where the change was made.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20a%20persistent%20object%20cache%3F\"><h3>Does it work with a persistent object cache?<\/h3><\/dt>\n<dd><p>Yes. With the default store setting <code>auto<\/code> and a persistent object cache (such as Redis or Memcached), the payloads are kept in the <code>rfrac<\/code> object-cache group and the plugin serves a hit from the object cache without querying its database tables; the entry metadata and tags stay in the database tables, so invalidation and pruning keep working. Set <code>RFRAC_STORE<\/code> to <code>database<\/code> or <code>object_cache<\/code> to choose explicitly.<\/p><\/dd>\n<dt id=\"does%20it%20support%20multisite%3F\"><h3>Does it support multisite?<\/h3><\/dt>\n<dd><p>Yes. Every site has its own tables, settings and cache. A network activation sets up the first 100 sites immediately (filter <code>rfrac\/network_activation_batch<\/code>) and the others on their next request; new sites are set up automatically. The must-use file is shared by the network, so only network administrators can install it from the admin. The admin pages are per site, and <code>wp rfrac flush<\/code>, <code>wp rfrac list<\/code> and <code>wp rfrac prune<\/code> accept <code>--network<\/code>. An archived, spammed or deactivated site is never served from the cache, and its cache is flushed when its status changes.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20woocommerce%3F\"><h3>Does it work with WooCommerce?<\/h3><\/dt>\n<dd><p>Yes, for the public catalog. The plugin caches the anonymous <code>GET<\/code> catalog routes of the WooCommerce Store API under <code>\/wc\/store<\/code> and <code>\/wc\/store\/v1<\/code>: products (the list, by ID and by slug), product attributes (the list, by ID and the terms of an attribute), product categories (the list and by ID), product brands (the list and by identifier), product tags, product reviews and the collection data.<\/p>\n\n<p>These routes are off until you enable them: use \"Enable WooCommerce catalog\" under REST API Cache \u2192 Routes, or enable single routes there.<\/p>\n\n<p>A stock change flushes the cached responses that show the product, including the product lists it appears in. All product lists are flushed only when a product goes in or out of stock, so orders do not keep the catalog cache cold.<\/p>\n\n<p>Never cached: the cart, checkout, order, batch and shopper-list routes, the <code>wc\/agentic<\/code> and <code>wc\/private<\/code> routes, <code>wc\/v3<\/code> and every other authenticated WooCommerce API, and every request of a logged-in shopper.<\/p>\n\n<p>Prices: the product list, a single product and the collection data carry prices. For an anonymous request WooCommerce computes them from the shop's base location, unless a plugin changes the tax location through <code>woocommerce_get_tax_location<\/code>, as geolocation and multi-currency plugins do. While a callback is hooked on that filter, shops with location pricing get no caching of products or collection data: those responses are neither served from nor stored in the cache, so a price computed for one visitor is never shown to another. The filter <code>rfrac\/woocommerce\/location_pricing<\/code> receives whether such a callback was detected: return true to bypass these routes regardless, or false to cache them although a callback is hooked. It is compiled into the configuration, so a change takes effect after the next recompile.<\/p>\n\n<p>A currency plugin that keeps the visitor's currency in a cookie can declare that cookie with <code>rfrac\/woocommerce\/currency_cookies<\/code>. Products and collection data are then cached once per allowed value, and a request with any other value is not cached:<\/p>\n\n<pre><code>add_filter(\n    'rfrac\/woocommerce\/currency_cookies',\n    function () {\n        return array( 'wmc_current_currency' =&gt; array( 'EUR', 'USD', 'GBP' ) );\n    }\n);\n<\/code><\/pre>\n\n<p>Plugins that vary prices per visitor in any other way, without a declared cookie, are not supported: the plugin cannot tell their responses apart. Keep the product and collection-data routes disabled on such a shop.<\/p>\n\n<p>The plugin is compatible with High-Performance Order Storage (HPOS) and with the cart and checkout blocks. It is tested with WooCommerce 11.3, which requires WordPress 7.0. Site Health \u2192 Info shows the WooCommerce version, whether HPOS is on, how many catalog routes are enabled, whether the route snapshot is current, whether products and collection data are cached or bypassed and why, and which currency cookies are declared.<\/p>\n\n<p>WooCommerce registers only the requested namespace on requests to its own namespaces, so the plugin does not rebuild its route snapshot from them. On a site whose REST traffic only reaches WooCommerce namespaces, route and setting changes and the first route discovery after activation apply only after a settings save or a REST request to another namespace.<\/p><\/dd>\n<dt id=\"does%20it%20work%20on%20a%20site%20served%20on%20several%20domains%3F\"><h3>Does it work on a site served on several domains?<\/h3><\/dt>\n<dd><p>Yes. A request on a host other than the site's home host (the host of <code>home_url()<\/code>) is cached apart from the requests on the home host, so a response whose links follow the request host, as on a site that builds <code>WP_HOME<\/code> from <code>HTTP_HOST<\/code>, is never served to a visitor on another domain. The entries of the home host are unchanged. Flushing a URL reaches the entries of every host. The home host is part of the compiled configuration, so a changed home host is picked up at the next compile, which flushes the cache.<\/p><\/dd>\n<dt id=\"can%20i%20use%20it%20together%20with%20a%20page%20cache%20or%20a%20cdn%3F\"><h3>Can I use it together with a page cache or a CDN?<\/h3><\/dt>\n<dd><p>Yes. This plugin caches REST responses inside WordPress. A page cache or CDN in front of WordPress may cache REST responses itself, and this plugin does not purge it. Use the <code>rfrac\/flushed<\/code> action to purge your CDN when entries are flushed, or exclude <code>\/wp-json\/<\/code> from the page cache.<\/p><\/dd>\n<dt id=\"do%20the%20rest%20api%20restrictions%20of%20other%20plugins%20apply%20to%20cached%20responses%3F\"><h3>Do the REST API restrictions of other plugins apply to cached responses?<\/h3><\/dt>\n<dd><p>Not on a cache hit. The must-use file serves a hit before regular plugins load; in fallback mode, without the must-use file, a hit is served on <code>plugins_loaded<\/code>, before <code>init<\/code> and the REST API run. A restriction that another plugin adds later, while the request runs, such as blocking an IP address or a country, rate limiting, or a <code>rest_authentication_errors<\/code> filter, is not applied to it. Only responses that a visitor who is not logged in received with <code>200 OK<\/code> are stored, so a route that such a restriction blocks for every visitor who is not logged in is no longer stored once the restriction is in place. Entries stored before that, for example before you activated the plugin that adds the restriction or before the restriction was added in code, keep being served until they expire: flush the cache (REST API Cache \u2192 Tools or <code>wp rfrac flush --all<\/code>) or exclude the route. A restriction that blocks only some visitors (by IP address, country or request rate) does not stop the response another visitor received from being served to them. Exclude such routes under REST API Cache \u2192 Routes, or let their requests bypass the cache with the <code>rfrac\/bypass_cookie_prefixes<\/code> or <code>rfrac\/bypass_headers<\/code> filter (or the <code>RFRAC_BYPASS_COOKIES<\/code> and <code>RFRAC_BYPASS_HEADERS<\/code> constants). The same holds for a route whose permission callback checks a secret request header or the visitor's IP address: add that header to the bypass headers, or do not cache the route.<\/p><\/dd>\n<dt id=\"how%20much%20database%20space%20can%20the%20cache%20use%3F\"><h3>How much database space can the cache use?<\/h3><\/dt>\n<dd><p>The cache keeps at most about 1.5 times the Maximum entries setting of active entries, each up to the Maximum response size, plus a small row and its tags per entry. With the defaults (10,000 entries of up to 1,024 KB) that is up to about 15 GB of active entries in the worst case, when every stored response is close to the size limit; most REST responses are far smaller. A flush only marks entries as flushed: they keep their payloads, and do not count towards that limit, until the hourly maintenance deletes them. After a broad flush the tables can therefore hold the flushed entries and a new set of active ones, so that bound is not hard. Visitors choose the URLs they request, so anyone can fill the cache up to the limit with different parameter values (pages, <code>per_page<\/code>, <code>include<\/code> or <code>_fields<\/code>). The hourly maintenance deletes flushed and expired entries and evicts the least recently used active entries above Maximum entries, so entries that are never requested again go first, and no new responses are stored while the cache holds 1.5 times the limit in active entries. Once a maintenance run has finished its work, no flushed entries are left and at most Maximum entries active ones. On a host with a small database quota, lower Maximum entries or Maximum response size under REST API Cache \u2192 Settings (or with <code>RFRAC_MAX_ENTRIES<\/code> and <code>RFRAC_MAX_PAYLOAD_KB<\/code>). With the object-cache store the payloads are kept in the object cache, not in the database tables.<\/p><\/dd>\n<dt id=\"can%20i%20run%20it%20next%20to%20wp%20rest%20cache%3F\"><h3>Can I run it next to WP REST Cache?<\/h3><\/dt>\n<dd><p>No. While WP REST Cache is active, this plugin pauses caching completely. A notice says so on the Plugins screen and on the plugin's own pages, and each user can dismiss it for themselves; REST API Cache \u2192 Tools keeps showing that caching is paused. The plugin never deactivates WP REST Cache and never changes its settings or data. You can import the settings of WP REST Cache while it is active (see the next question), but caching only starts once you deactivate WP REST Cache.<\/p><\/dd>\n<dt id=\"how%20do%20i%20switch%20from%20wp%20rest%20cache%3F\"><h3>How do I switch from WP REST Cache?<\/h3><\/dt>\n<dd><p>Install and activate this plugin, import the settings of WP REST Cache, then deactivate WP REST Cache. Caching stays paused until you do, and nothing is imported unless you ask.<\/p>\n\n<p>Import from the notice on the Plugins screen (\"Review on the Import page\" previews it without saving) or with <code>wp rfrac import-legacy<\/code> (<code>--dry-run<\/code> previews, <code>--network<\/code> runs on every site of a network). The report gives every value a status: Imported, Kept, Adjusted, Skipped or Unsupported. The cache entries of WP REST Cache are not imported and its data stays untouched.<\/p>\n\n<p>Afterwards, check for <code>X-Rfrac-Cache: HIT<\/code>, <code>MISS<\/code> or <code>BYPASS<\/code> instead of <code>X-WP-Cached-Call<\/code>, and use <code>wp rfrac flush<\/code> instead of <code>wp wp-rest-cache flush<\/code>. The full guide, with the notices and the report explained: https:\/\/rockfire.nl\/docs\/migration\/<\/p><\/dd>\n<dt id=\"do%20my%20wp%20rest%20cache%20constants%20still%20work%3F\"><h3>Do my WP REST Cache constants still work?<\/h3><\/dt>\n<dd><p>Two do, while the <code>RFRAC_*<\/code> constant that replaces them is undefined: the setting is then locked under REST API Cache \u2192 Settings.<\/p>\n\n\n\n\n  Constant\n  Replacement\n  What happens\n\n\n\n\n  <code>WP_REST_CACHE_TIMEOUT<\/code> and <code>WP_REST_CACHE_TIMEOUT_INTERVAL<\/code>\n  <code>RFRAC_DEFAULT_TTL<\/code>\n  Works: the default TTL is their product in seconds, cut to the maximum TTL (30 days by default; raise Max TTL or <code>RFRAC_MAX_TTL<\/code> for up to one year).\n\n\n  <code>WP_REST_CACHE_GLOBAL_CACHEABLE_REQUEST_HEADERS<\/code>\n  <code>RFRAC_GLOBAL_VARY_HEADERS<\/code>\n  Works: request headers that vary the cache key on every route, at most 5, none that carries credentials. An invalid value is ignored.\n\n\n  <code>WP_REST_CACHE_REGENERATE<\/code>, <code>WP_REST_CACHE_REGENERATE_INTERVAL<\/code> and <code>WP_REST_CACHE_REGENERATE_NUMBER<\/code>\n  none\n  No effect: expired entries are not regenerated.\n\n\n  <code>WP_REST_CACHE_MEMCACHE_USED<\/code>\n  none\n  No effect.\n\n\n\n\n<p>The Site Health test \"WP REST Cache compatibility\" reports each old constant that is defined.<\/p><\/dd>\n<dt id=\"do%20my%20wp%20rest%20cache%20hooks%20still%20work%3F\"><h3>Do my WP REST Cache hooks still work?<\/h3><\/dt>\n<dd><p>Most do. The plugin fires most old <code>wp_rest_cache\/\u2026<\/code> hooks from their replacement hook, and WordPress reports each as deprecated while WP_DEBUG is on. <code>wp_rest_cache\/cache_key<\/code>, <code>wp_rest_cache\/filter_cache_output<\/code> and <code>wp_rest_cache\/pre_output_headers<\/code> have no replacement hook. A cache hit applies no plugin filters, so callbacks that depend on the request run on hits only with <code>define( 'RFRAC_LEGACY_HIT_FILTERS', true );<\/code> in <code>wp-config.php<\/code>, which makes hits slower. A hit then applies the old filters directly, as plain filters that never log a notice. A hit served by the must-use file <code>rfrac-early-cache.php<\/code> comes before plugins and the theme load, so their callbacks do not run on it: hook them in a must-use plugin that sorts before <code>rfrac-early-cache.php<\/code>. <strong>Without the constant nothing is stored while <code>wp_rest_cache\/cache_key<\/code> or <code>wp_rest_cache\/filter_cache_output<\/code> is hooked<\/strong> (reason <code>filtered<\/code>): define the constant or unhook the callback.<\/p>\n\n<p>The hooks of removed features no longer fire; REST API Cache \u2192 Import and Site Health list the ones your site still uses. Every old hook with its replacement: https:\/\/rockfire.nl\/docs\/migration\/legacy-hooks\/<\/p><\/dd>\n<dt id=\"does%20code%20that%20calls%20wp%20rest%20cache%20classes%20still%20work%3F\"><h3>Does code that calls WP REST Cache classes still work?<\/h3><\/dt>\n<dd><p>Calls do not cause a fatal error once WP REST Cache is removed: seven classes have a shim, among them <code>Caching<\/code>, <code>Endpoint_Api<\/code> and the controllers <code>Post_Controller<\/code>, <code>Term_Controller<\/code> and <code>Attachment_Controller<\/code>. A call that still works, such as <code>Caching::delete_cache_by_endpoint()<\/code> or <code>delete_related_caches()<\/code>, runs its replacement (<code>rfrac_flush_url()<\/code>, <code>rfrac_flush_route()<\/code> or <code>rfrac_flush_tag()<\/code>) and raises a deprecation notice. Any other call does nothing, returns a neutral value and is listed under \"Classes\" in REST API Cache \u2192 Import and Site Health.<\/p>\n\n<p>Routes registered with the old controllers are no longer cached automatically: enable them under REST API Cache \u2192 Routes. The shims only cover calls made from <code>plugins_loaded<\/code> or later. Every method and what it does now: https:\/\/rockfire.nl\/docs\/migration\/legacy-classes\/<\/p><\/dd>\n<dt id=\"what%20does%20uninstalling%20remove%3F\"><h3>What does uninstalling remove?<\/h3><\/dt>\n<dd><p>Deleting the plugin from the Plugins screen removes, on every site of the network: the <code>rfrac_entries<\/code> and <code>rfrac_tags<\/code> tables, every option and transient whose name starts with <code>rfrac_<\/code>, the network options, user meta whose key starts with <code>rfrac_<\/code> or with the site's table prefix followed by <code>rfrac_<\/code>, the maintenance cron events, the <code>rfrac<\/code> object-cache group (when the object cache supports flushing a group) and the must-use file <code>rfrac-early-cache.php<\/code>. Deactivating flushes the cache of the site, unschedules its maintenance cron events and removes the must-use file (unless the plugin is still active on another site of the network); the tables and settings stay.<\/p><\/dd>\n<dt id=\"where%20do%20i%20report%20security%20bugs%20found%20in%20this%20plugin%3F\"><h3>Where do I report security bugs found in this plugin?<\/h3><\/dt>\n<dd><p>Please report security bugs found in the source code of the Rockfire \u2013 REST API Cache plugin through the <a href=\"https:\/\/patchstack.com\/database\/vdp\/3b6565d9-6316-455d-8034-ac732df8b164\">Patchstack Vulnerability Disclosure Program<\/a>. The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First public release.<\/li>\n<li>Early serving of cache hits from a must-use file, with a fallback mode when the file is not installed.<\/li>\n<li>A route manager to enable or exclude any registered route and set its TTL, accepted parameters and vary headers.<\/li>\n<li>Tag-based invalidation that flushes the responses carrying the posts, terms, users, comments and lists that change.<\/li>\n<li>A public PHP API to flush by tag, URL, route or everything and to add your own tags: <code>rfrac_flush_tag()<\/code>, <code>rfrac_flush_url()<\/code>, <code>rfrac_flush_route()<\/code>, <code>rfrac_flush_all()<\/code> and <code>rfrac_tag_response()<\/code>.<\/li>\n<li>Pruning of flushed and expired entries, and limits on the entry count, payload size, query parameters, query length and tags per entry.<\/li>\n<li>An object-cache store that serves payloads from a persistent object cache without querying the database tables.<\/li>\n<li>WP-CLI commands: <code>wp rfrac flush<\/code>, <code>wp rfrac list<\/code>, <code>wp rfrac status<\/code>, <code>wp rfrac prune<\/code>, <code>wp rfrac import-legacy<\/code> and <code>wp rfrac config get<\/code>.<\/li>\n<li>Multisite support with per-site tables and settings, network activation and <code>--network<\/code> options in WP-CLI.<\/li>\n<li>Caching of the public WooCommerce Store API catalog, which you enable under REST API Cache \u2192 Routes.<\/li>\n<li>Admin screens to browse and flush cached responses, manage routes and settings and check the must-use file, and Site Health checks that report problems.<\/li>\n<li>Built from WP REST Cache 2026.3.1 (GPLv3): imports its settings on request, keeps its public classes and hooks working while it is absent, and pauses caching while it is active.<\/li>\n<\/ul>","raw_excerpt":"Fast, security-hardened caching for the WordPress REST API, with tag-based invalidation, a route manager and WP-CLI commands.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/412170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=412170"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rockfire"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=412170"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=412170"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=412170"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=412170"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=412170"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=412170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}