Key Features • How To Use • Implimentation
Clorine is a simple and easy to use caching library for java. It uses LRU (Least recently used) algorithim for saving and deleting cache. This library facilates In-memory cache along with disk cache. Means that your cache is actually sotred on the disk but a another in-memory cache is also created when you use that cache frequently to save time.
- Super simple, made using the most simples design ever
- Automatically manage the cache heap and memory
- Can directly cache objects (POJO's)
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.ErrorxCode:Clorine:Tag'
}
Step 1. Add to project level file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the dependency
<dependency>
<groupId>com.github.ErrorxCode</groupId>
<artifactId>Clorine</artifactId>
<version>Tag</version>
</dependency>
The usage of this library is this much simple that it cannot be explained in words.
Cache demo = Clorine.createOrOpen(20,"demo",cacheDir);
20 is the limit of data/objects in the memory cache. There is no limit in disk cache.
// To store cache, you don't need to do anything else
cache.put("name","xcode");
cache.put("person1",new Person("xcode",5,false));
cache.put("person2",new Person("frank",42,true));
// To get data
cache.get("name",String.class);
cache.get("person",Person.class);
If you like my work then you can suppot me by giving this repo a ⭐. You can check my other repos as well, if you found this library userfull then you will definetly fine more in my profiles.
- CloremDB - A realm like embadded database
- ClorographDB - CLorabase offline graph database
A account less backend for android