api.rb:177 onwards reads:
api_cache.get_or_set(cache_key, nil, 5) {
res = http_client.get(url, data, 'Accept' => 'application/json')
case res.code
when '200'
res
and later, line 207 onwards:
resp = get(url, access_token, http_client, api_cache)
json = JSON.load(resp.body)
This works with an in-memory cache, as the actual object is stored in memory.
This construct does not allow us to use a Redis-based cache, as Redis will store the string representation of the HTTP client's response (e.g. Net::HTTPOK) instead of the actual response's body.
Suggested change: have line 181 return res.body.
api.rb:177onwards reads:and later, line 207 onwards:
This works with an in-memory cache, as the actual object is stored in memory.
This construct does not allow us to use a Redis-based cache, as Redis will store the string representation of the HTTP client's response (e.g.
Net::HTTPOK) instead of the actual response's body.Suggested change: have line 181 return
res.body.