Caching API requests

Caching API requests
0.0 0

#1

Reading through documentation for different APIs I noticed they sometimes suggest caching requests for information that doesn’t change frequently. I thought that might be a good idea especially considering request limits. Does anybody know of some good resources for learning about this?


#2

You may use local storage for cashing api requests. each time the app needs to make a new api requests, before that you can compare the parameters to be sent with the ones stored in the local storage. if no change serve the response from local storage.

You may also set a time limit for cashing.


#3

I haven’t learned how to use local storage yet. I’ll have to look into that.

I was reading up on the fetch API. It sounds like the default behavior is to cache requests. Am I understanding that correctly? If that’s the case, I could just use fetch and let it take care of caching.