Hi @ctagupa
Thank you for using our plugin!
Yes that is possible using the filter wp_rest_cache/timeout
For example like this:
/**
* Set a different cache timeout for the posts endpoint.
*
* @param int $timeout The timeout as set in the settings.
* @param array $options An array of options, containing the current uri, the object type, the request headers and the request method.
*
* @return int
*/
function wprc_set_posts_timeout( $timeout, $options ) {
/**
* Available keys in $options are: uri, object_type, request_headers, request_method
*/
if ( 'posts' === $options['object_type'] || '/wp-json/wp/v2/posts' === $options['uri'] ) {
$timeout = MONTH_IN_SECONDS;
}
return $timeout;
}
add_filter( 'wp_rest_cache/timeout', 'wprc_set_posts_timeout', 10, 2 );