开发者 |
acato
rockfire yoeridekker |
---|---|
更新时间 | 2025年6月25日 20:31 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.8 |
版权: | GPLv3 |
版权网址: | 版权信息 |
GET
-endpoints.No, the plugin will automatically flush all cache related to the page/post you just edited.
Yes, the plugin will automatically cache the endpoint of custom post types. Unless you have created a custom WP_REST_Controller for it, then it will not automatically cache the endpoint.
Yes, the plugin will automatically cache the endpoint of custom taxonomies. Unless you have created a custom WP_REST_Controller for it, then it will not automatically cache the endpoint.
No, the plugin will not cache your custom endpoint unless you tell it to cache it using the hook wp_rest_cache/allowed_endpoints
(See 'Can I register my own endpoint for caching?'). Please keep in mind that once you do so the plugin will not automatically flush the cache of that endpoint if something is edited (it has no way of knowing when to flush the cache). It will however try to determine the relations and for the determined relations it will flush the cache automatically once the relation is edited.
Yes you can! Use the hook wp_rest_cache/allowed_endpoints
like this:
`/**
Yes you can! Use the hook wp_rest_cache/allowed_endpoints
like this:
`/**
Yes you can! Add the GET-parameter skip_cache=1
to your call and no caching will be used.
Yes you can! Use the hook wp_rest_cache/determine_object_type
like this:
function wprc_determine_object_type( $object_type, $cache_key, $data, $uri ) { if ( $object_type !== 'unknown' || strpos( $uri, $your_namespace . '/' . $your_rest_base ) === false ) { return $object_type; } // Do your magic here $object_type = 'website'; // Do your magic here return $object_type; } add_filter( 'wp_rest_cache/determine_object_type', 'wprc_determine_object_type', 10, 4 );
Yes they can! Go to Settings > WP REST Cache, on the Settings tab you can check Enable cache regeneration
, this will activate a cron job which will check if there are any expired (or flushed) caches and regenerate them. Using the Regeneration interval
you can determine how often this regeneration process should run. The Max number regenerate caches
limits the number of regenerated caches per regeneration process, this is so your server doesn't get flooded with the regeneration calls.
Yes you can! Use the hook wp_rest_cache/display_clear_cache_button
like this:
function wprc_display_clear_cache_button( $show ) { return false; } add_filter('wp_rest_cache/display_clear_cache_button', 'wprc_display_clear_cache_button', 10, 1);
Yes you can! There are two options for this:
Global cacheable request headers
. This is a comma seperated list. These headers will be used for ALL endpoints.wp_rest_cache/cacheable_request_headers
to specify per endpoint which request headers should be used. Like this:
function wprc_add_cacheable_request_headers( $cacheable_headers ) { $cacheable_headers['wp/v2/posts'] = 'LANG'; return $cacheable_headers; } add_filter('wp_rest_cache/cacheable_request_headers', 'wprc_add_cacheable_request_headers', 10, 1);
Yes you can! Use the hook wp_rest_cache/settings_capability
like this:
function wprc_change_settings_capability( $capability ) { // Change the capability to users who can edit posts. return 'edit_posts'; } add_filter('wp_rest_cache/settings_capability', 'wprc_change_settings_capability', 10, 1);
Yes you can! Use the wp wp-rest-cache flush
command to flush caches. Type wp wp-rest-cache flush --help
to see all options.
We are using the WordPress transient API, so as long as you are using a Redis Object Cache plugin which enables Redis caching through the transients API it is supported.
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage and handle any security vulnerabilities. Report a security vulnerability.