Cache WordPress REST API Requests to Increase App Speed

By Tejaswini Deshpande | November 28, 2020

With WordPress 4.7, RESTful API is a part of the core and developers are going to use REST API for retrieving WordPress data in Mobile and Web Apps. REST API that is got from allows developers to communicate with the WordPress Core without using the website. For example, one can fetch your blog meta information inside his mobile app and even update the data in your WordPress site without login. With the help of REST API, other programming languages like Java can communicate and work with the core WordPress data and that data can be used in applications. So REST API in WordPress has opened endless possibilities with this awesome CMS platform and people have already started using these features.

Some popular magazine site like Wired are already using the power of REST API in WordPress and making a great use of it.

Communication with WordPress core through REST API is like asking for data and then submitting the same (if needed). Every time the request will be made and the data will be provided by core WordPress. It consumes CPU and executes many functions in core WordPress. Such communication (if made frequently) may slow down the core WordPress and some cases may crash the app. To avoid such situation, it is important to use Cache for WordPress REST API.

Caching is like fulfilling the same request without loading the core functions all the time. We have already seen PHP caching in WordPress using plugins like WP Super Cache and W3 Total Cache. Similar caching is possible with REST API and it will increase the app speed.

Leave a Reply

Your email address will not be published. Required fields are marked *