Save data from an API call to server cache

what if i call the API say every 10 seconds and store that data (var a, b and c). On each subsequent call i overwrite existing a,b,c variables so when user lands on the page data he gets is from current values of a,b,c?