Deprecated: version_compare(): Passing null to parameter #2 ($version2) of type string is deprecated in /var/www/html/wpxss.com/application/wp-content/plugins/tweet-old-post-pro/vendor/codeinwp/themeisle-sdk/load.php on line 24

Deprecated: version_compare(): Passing null to parameter #2 ($version2) of type string is deprecated in /var/www/html/wpxss.com/application/wp-content/plugins/tweet-old-post-pro/vendor/codeinwp/themeisle-sdk/load.php on line 29

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wpxss.com/application/wp-includes/functions.php on line 6260

Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/html/wpxss.com/application/wp-content/plugins/wp_glossary/includes/class-wpg-linkify.php on line 316
Cache REST API responses and speed up WordPress REST API requests - wpXSS
Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/html/wpxss.com/application/wp-content/plugins/wp_glossary/includes/class-wpg-linkify.php on line 316

Deprecated: Function wp_get_loading_attr_default is deprecated since version 6.3.0! Use wp_get_loading_optimization_attributes() instead. in /var/www/html/wpxss.com/application/wp-includes/functions.php on line 6260
WP-CLI » Cache REST API responses and speed up WordPress REST API requests

Cache REST API responses and speed up WordPress REST API requests


Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/html/wpxss.com/application/wp-content/plugins/wp_glossary/includes/class-wpg-linkify.php on line 316

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  How to send AJAX requests in a WordPress theme or plugins

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