The ability to cache and reuse previously retrieved resources is very essential for improving the performance of a REST application. The HTTP/1.1 protocol specification provides a number of features to facilitate the caching of network resources. These offerings can be leveraged for improving the performance of the RESTful web APIs accessed over the HTTP protocol.
Caching RESTful web API results
HTTP Cache-Control directive
The HTTP Cache-Control directive defines the HTTP response caching policies. You can use it for enabling the caching of the RESTful web API results for a specified interval. Here is a quick summary of the important HTTP Cache-Control directives:
HTTP Cache-Control directive |
Description |
public ... |