I have a simple endpoint. Its GET, I pass it an ID parameter and it uses this ID to make a curl call. The endpoint then responds with a couple pieces of info json_encoded.
The issue is that this endpoint keeps caching its results. How do I keep this from happening?
Couple notes:
- No caching plugins installed
- WP config doesn't note caching
The endpoint code is pretty simple:
// Get Number of people in line
add_action( 'rest_api_init', function () {
register_rest_route( 'cc/v1', '/in_line/(?P<id>\d+)', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'in_line',
'args' => [
'id'
],
) );
} );
function in_line($data) {
//Do a bunch of Curl stuff
$response['queue'] = $number;
$response['queueID'] = $data['id'];
return json_encode($response);
}
I call the endpoint via jQuery ajax.