Building RESTful Web Services with Spring 5(Second Edition)
上QQ阅读APP看书,第一时间看更新

Cacheable

With RESTful web services, a client can cache any response coming from the server. The server can mention how, and for how long, it can cache the responses. With the caching option, a client can use the responses instead of contacting the server again. Also, caching will improve scalability and performance by avoiding client-server interactions all the time.

This principle has significant advantages for scalability. Caching techniques will be discussed in Chapter 8, Performance.

Since REST typically leverages HTTP, it inherits all the caching properties that HTTP offers.