Storing Android Client and Cache Drive with Picasso

I use Picasso to upload images to a container. I want to cache in memory and cache on disk. What is the best way to cache image on disk? Which http client is the best option?

These are my requirements:

  • First cache check in memory
  • Check cache on disk
  • Get the image from the server.

If the image is on disk → check cache interval (max-age) and check with the server if the image is out of date. The server needs an if_none_match: eTag .

I read that this function is built into the OkHttp api, but I do not know how to use it. Please, I would appreciate if someone would send me a link, documentation, or any other way to do this, that you might think.

+5
source share

Source: https://habr.com/ru/post/1208217/


All Articles