Start a new topic

Techniques For Caching

Hello All,

I am looking to develop a good way to cache things from the database to make the app faster. Does anyone know some good strategies that will help me in caching data. I am doing research on the subject, but just wanted to get some other opinions about caching and see if there is anything that Kinvey does to help out on that front.

Thanks in Advance,


Ummm so after some research on the Kinvey documentation I found this:

I feel kinda foolish now but if anyone is wondering Kinvey does support this.
Haha, thanks Sean!
On another note, does anyone know how the Kinvey caching works? Is the caching based off of the store that is used? Meaning if I create a new store the is automatically nothing cached for it?


To use caching, you have to use the appropriately configured store, however the stores share a global cache per collection, so if you read with one store, another one with the same collection will be able to retrieve those results.
Ok, what i am wondering is I have multiple stores being used to access data, most of the time each one of this stores accesses the same data. How will this work with Kinvey caching?

If I have a separate store for each will it cache things separately as well?

If that is not the case then will the cache keep track of which store uses which data? Or will it only keep track of the last call on that store?


Each store has a reference to the global cache. When caching is enabled, and results come back from the server those results are added to the cache or updated if those entities were in the cache. When the cache is read (depending on the store's policy) it will pull the latest results, regardless of which store object was used to write to the cache.
Great it seems to be working as expected except one thing. For some reason the skip and limit modifiers do not seem to be working with the caching.
Can you provide an example of what you mean?

I have the KCSAppdataStore set up working great right now where it will get 0 to 20 the first go around and then the next call will get 20 to 40 and the next will get 40 to 60. It works great and has been working great for some time. As soon as I switch it to the KCSCacheStore(spelling) when I get the first 20 it works fine. And the caching works great as well if I come back to that screen it will get the cached results fine but as soon as I try to get 20 to 40 of the objects it will get the cached results of 0 to 20 and redisplay them. So it seems like the cached results ignore the skip and limit modifiers on the query when it is checking and comparing cached results.

I have not updated Kinvey SDK in a bit so I will do that now and report back and let you know what is going on with it.


I think there is a bug here.
Login or Signup to post a comment