WP-CLI » Cache REST API responses and speed up WordPress REST API requests

Cache REST API responses and speed up WordPress REST API requests

When using WordPress REST API each request is processed by WordPress and depending on the size of the database and server performance, issues start occurring for high-traffic websites. By using a plugin such as WP REST Cache you can cache the responses of the REST API, making it much faster.

Then if you want to always view uncached REST API responses you can add the following line to the request header:

Cache-Control: private or Cache-Control: no-cache

Apart from caching the response, there are also a few more methods to speed up WP REST API response time, here are some useful guides:

See also  Use PHP Regex Replace Line-by-Line to remove Malware from large Database Dumps

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended