React Request's two most useful features are request deduplication and response caching.
Both of these features are powered by a system called "request keys," which are strings that allow React Request to determine if two requests are to be considered identical.
A request key is a string that is created from the props that you pass to Fetch
.
The key is composed of these pieces of information:
url
method
body
Request Deduplication
When two or more <Fetch/>
components with the same key attempt to fire off a request, only one HTTP
request will be sent off. When the response is returned, all of the components will
receive that single response.
For more, see the guide on request deduplication.
Response Caching
Anytime a response is received for a request, it is stored in an internal cache. If a subsequent request is attempted with the same key, then the cached version will be returned instead.
For more, see the guide on response caching.