Currently any time data is needed, a request is sent. Oftentimes an identical request has recently been made and if the data from this was cached, this cache could be used instead to prevent unnecessary traffic.
Since we want the data to remain more or less live we will need to make identical requests so can't keep the cache forever.
Since the minimum data refresh time is 1 minute, this would be a suitable length to keep any cached request responses.
Pseudocode:
makeRequest:
if requestIsCached and requestAgeMinsLessThan(1):
return cachedResult
else:
makeTheRequest()
Currently any time data is needed, a request is sent. Oftentimes an identical request has recently been made and if the data from this was cached, this cache could be used instead to prevent unnecessary traffic. Since we want the data to remain more or less live we will need to make identical requests so can't keep the cache forever. Since the minimum data refresh time is 1 minute, this would be a suitable length to keep any cached request responses.
Pseudocode: