What should I use to cache API fetching results?

I am writing a client and want to cache what users get so it saves a request the second time. What’s the simplest thing to use in this case?

1 Like

If you want to cache entire http requests use Varnish/Squid. But for caching for eg. a single query result you have to play with cache on the backend side (memcached/redis etc) -> https://github.com/zackehh/cachex

@edit: Now I see that you are talking about a client, not a server. So If you can’t configure some proxy, use in memory-cache (eg. redis) or file-based solution.

1 Like

There’s also ETS depending on exactly how much you are willing to cache.

My wording was confusing! I’m making an Elixir API client for the Pokemon API. As in, a library which you can easily make requests with. It uses HTTPoison under the hood. I want to save each query result somewhere so that if it’s asked again it doesn’t make a request.

2 Likes

@sotojuan just curious, did you find some good solution to your problem?
I’m having exact problem right now.