How to avoid caching of certain routes under main namespace
-
function add_custom_endpoint_cache( $allowed_endpoints ) {
if ( ! isset( $allowed_endpoints[ ‘api-json’ ] ) ) {
$allowed_endpoints[ ‘api-json’ ][] = ”;
}
return $allowed_endpoints;
}I am caching all my custom rest APIs but I need some certain APIs not to be cached
example : /wp-json/api-json/travels , /wp-json/api-json/customerslet’s say I wanna cache all the other APIs except those
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to avoid caching of certain routes under main namespace’ is closed to new replies.