How to cache Web API response?

What is the best way to cache an API response in Ruby on Rails?

Matt Smith at Quora Visit the source

Was this solution helpful to you?

Other answers

you can cache the hole json response in redis. create then a presenter of a struct that represent the json. add version to the json response, then you can make a cheap get call to the api, and check the version, if is the same, return from redis, if not, to bad, get the response and cache it :) ps: I'm a junior dev

Claudiu Ion

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.