Caching Data

Storing a local copy of SendBird data in a device helps users look through their messages and channels even while offline. It can also prevent the inefficiency of repeating queries upon each connection or device state change, as well as provide a smoother user experience by reducing data loading delays.

In this document, we show you how to build a local cache using object serialization/deserialization, which is provided through the SDK. In the Basic caching using a file section, we provide instructions on building a simple cache that stores the most recent messages and channels in a file. In the Advanced caching using a database section, you can find instructions on caching data in an internal database, which helps you store structured and queriable data.