skip_cache returns endpoint description instead of data
-
Hello, thank you for the amazing work on this plugin, I’m just having a small problem where I’m trying to call my API without the cached response for a staging site.
However, I’m running into a strange error where using this parameter causes the request to fail.
I have a custom endpoint, declared (for example) like so:
add_action( 'rest_api_init', function () { register_rest_route( 'my_custom_example/v1', '/test_endpoint', array( 'methods' => 'GET', 'callback' => 'my_custom_test', ) ); });If i call the endpoint,
domain.com/wp-json/my_custom_example/v1/test_endpoint, it works, but if I calldomain.com/wp-json/my_custom_example/v1/test_endpoint?skip_cache=1, I get the following response:{“namespace”:”my_custom_example\/v1″,”methods”:[“GET”],”endpoints”:[{“methods”:[“GET”],”args”:[]}],”_links”:{“self”:”https:\/\/domain.com\/wp-json\/my_custom_example\/v1\/test_endpoint”}}
Adding a
/after between the URL and the param causes the regular cached data to return.It seems like some sort of routing issue, but I’m not sure how to proceed.
The topic ‘skip_cache returns endpoint description instead of data’ is closed to new replies.