plugin development – WP REST API seems to cache responses
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?
Leave an answer