Hi @holaeffect
It is still a work in progress and we are brainstorming how it should actually work / where you can do the settings exactly), but the general idea is this:
In the settings of the plugin you can set which request headers should be used (or possibly via a hook so you can set it per endpoint).
So if for instance you are sending a header WPLANG
(to set which language should be returned), you then set it as cacheable header. And each time you do a request to the WP REST API, the caching plugin will check if there is already a cache record for the requested url combined with the correct WPLANG
header.
So a call to /wp-json/wp/v2/posts
with request header WPLANG
set to en_US
will result in a different cache than a call to the same url /wp-json/wp/v2/posts
but with the request header WPLANG
set to nl_NL
.
What you want could be quite hard (maybe even impossible) to implement correctly. You want specific items not to be cached. But what if that item is one of the items returned by the /wp-json/wp/v2/posts
endpoint? That would mean we cannot cache that endpoint at all?
I am going to think about it a bit more, to see if maybe we can come up with a workable solution for this.