I checked this https://ww.wp.xz.cn/support/topic/support-for-the-_embed-query-param/, i am testing on localhost and the define(‘WP_CACHE’, true); is not on wp-config.
A strange behavior is that posts endpoint works fine, it happens on search endpoint only (/wp-json/wp/v2/search?search=test&per_page=12&_embed).
Actually i get the data i want using register_rest_field, but it seems to be a bug.
Hi @andreescocard
Thank you for using our plugin!
First of all there is no reason why our plugin wouldn’t cache the _embedded part of the response. We simply take what we get from WordPress and cache it. We do not alter it in any way.
Second: out-of-the-box our plugin does not (yet) cache the search endpoint. This has to do with some technical issues we have to solve, but also with the fact that caching seems a lot less interesting for the search endpoint (there are unlimited search phrases a user can use and that would result in just as many cache records which would most of the time only be requested once.
Having said the above: I did try this locally with our plugin caching the search endpoint (using the wp_rest_cache/allowed_endpoints filter). However the _embedded part was present both in the cached as in the uncached version. So I am unable to reproduce the issue. Can it be you have any other plugin or code that does something to the _embedded?
Good question, anyway i solved the issue creating another endpoint.
I tested disabling another plugins too, the only one i could not disable (shows critical error) is advanced custom fields pro.
The strange is that it only removes the _embedded when i activate the plugin, if i disable, it shows normally.
Good to hear you solved it, but still creating another endpoint shouldn’t be necessary. I will keep an eye out to see if I encounter this issue somewhere else.