Member-only story
Build Your own Cache Manger
How to build a cache manager like Glide
In this article, we’re going to know what is Cache, understand how Glide’s Cache System and how to implement our own CacheManager using LRU strategy.
- What is Cache?
- How do we cache data?
- Cache Strategies.
- LRU Cache
- Understanding Glide
What is Cache?
Cache which is pronounced as CASH is a hardware or software that is used to store something, usually data, temporarily in a computing environment. The reasons for caching data is fast retrieval and lowering network cost. Fast retrieval of data will help to increase app responsiveness so that users get engaged better. In simple terms, we can say cache is a temporary storage of data.
How do we cache data?
Initially, we fetch data from any external source say network which may take a little bit of time after data is retrieved from the network, then the data is stored or cached locally for future retrieval. There are two main strategies listed below for implementing the cache system in Android.
Caching Strategies:
- Memory Cache: We store the data retrieved inside the memory of…