R
R
Rustem Saitkulov2015-08-31 13:16:37
Android
Rustem Saitkulov, 2015-08-31 13:16:37

What are the mechanisms for caching data in a mobile application?

Recommend manuals / articles on the main mechanisms for caching data in a mobile application.
I would like to support cached data in the application, but so that they are as valid as possible.
PS The question is not about how to store data, but about maintaining the relevance of the cached ones.
Specifically, I have the task of maintaining up-to-date data in the application, but the problem is that the backend is not ready for option No. 1 (ETag), so I'm looking for other ways.
So far I have settled on the option: cache validity time = 5 minutes, i.e. the application will try to get the data every time it needs it, but if there is a cache whose lifetime is less than 5 minutes, the request to the server will not go away. But I don't like this pattern. I don't see the difference between 5 minutes and 0 minutes in this case and it's sad.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rustem Saitkulov, 2015-08-31
@atetc

I know one of the options - ETag mechanism , but as I wrote in the question - the backend is not ready to support it now

I
IceJOKER, 2015-08-31
@IceJOKER

It is in Android that SharedPreferences is for this, it helps out a lot, either to save it to a file, or to the database, at the office. The site has a separate section for this.

S
Sergey Krasnodemsky, 2015-08-31
@Prognosticator

The word "valid" is out of place.
What are you caching? Backend data? Pictures?
I will assume that the backend data.
Here is a similar question on a toaster with a solution for android apps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question