Combining cached and live JSON in Rails
Had a scenario for the Supplybunny API where an endpoint needed to return a combination of live and cached data.
The cached part was already in use in a few places. The new endpoint needed to return a few different pieces so as to avoid making multiple calls.
Never encountered that before and didn’t really find much about it.
This is what I came up with:
Has worked well so far.