wp-json/wp/v2 not caching | WordPress.org

[ad_1]

I have a few JSON requests I’m making and none of them cache. Here are the three calls that I am making:

/wp-json/wp/v2/posts?_embed=wp%3Aterm%2Cwp%3Afeaturedmedia&per_page=10&page=1&orderBy=date&order=desc&lang=en&_locale=user

/wp-json/wp/v2/topic?_fields=id%2Cname%2Cslug&per_page=100&lang=en&_locale=user

/wp-json/wp/v2/content-region?_fields=id%2Cname%2Cslug&per_page=100&lang=en&_locale=user

In terms of the response I get, here is the output for the first one:

Request URL:
/wp-json/wp/v2/posts?_embed=wp%3Aterm%2Cwp%3Afeaturedmedia&per_page=10&page=1&orderBy=date&order=desc&lang=en&_locale=user
Request Method: GET
Status Code: 200 OK
Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type
Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link
Allow: GET, POST
Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
...

My hunch is this is not working based on the fact I’m getting a no-cache response for Cache-Control. Any insight would be greatly appreciated.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer