Vaguely disassemble the local data store and cache

I am developing an iOS application and I want to have a level of offline support, and I try my best to use a local data store or cache that is suitable for use, as it seems that you cannot use these two functions together.

My request is quite simple and does not change only the data that can be restored.

if I used one of the cache policies, I get connection errors and nothing is returned from the cache.

The im after workflow is in the lines below.

-> When connected to the Internet, requests are made locally and objects are stored.

-> if the Internet does not download previously downloaded objects.

+5
source share
1 answer

For the described workflow, I think you're looking for a cache. If you want the user to be able to change data without connecting, and then, when there is WiFi, synchronize local data with remote data, then you need local data storage behavior. The problem for me is that you want both to be in different parts of the same application, because when analyzing in your local data store you cannot use the cache. I really don't understand why!

+1
source

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


All Articles