-
-
Notifications
You must be signed in to change notification settings - Fork 14
Cache
Diego van Haaster edited this page May 13, 2021
·
1 revision
- You query for some data. Client checks the cache for the data. If all of the data is present in the cache, skip directly to step 4.
- If the cache is missing some of the data you asked for, Client will make a network request to your API.
- The API responds with the data, Client uses it to update the cache.
- The requested data is returned.
- You query for some data. Client checks the cache for the data.
- If the data is in the cache, return that cached data.
- Regardless of whether any data was found in step two, pass the query along to the API to get the most up-to-date data.
- Update the cache with any new data from the API.
- Return the updated API data.
- Client makes a network request for your data without checking the cache.
- The server responds with your data and the cache is updated.
- The data is returned.
- Client makes a network request for your data without checking the cache.
- The server responds and the data is returned without updating the cache.
- Client checks the cache for queried data.
- If all the data is present in the cache, it is returned (otherwise, an error is thrown).