plugin development – WP REST API seems to cache responses

Question

We have registered a custom rest endpoint using register_rest_route() and are sending multiple GET requests to the registered GET endpoint; which is basically a request to GET posts of a custom post type. The problem is that, even though we’re using cache-control: no-store in the according fetch() call in javascript; The response seems to be retrieved via the cache; as a response is returned which is not up to date anymore, multiple times.

Does WP somehow implement a default cache for their REST API? If yes, how shall we bypass this cache, and ensure that every request to specific API endpoints returns a fresh, new response and disregards the cache?

0
DevelJoe 2 months 2023-04-17T15:00:09-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse