Skip to main content

Redis Caching

Description
The application uses a custom implementation for Redis for caching (CacheManager.java).


Usage​

Save an Object​

CacheManager.saveObject(String key, long lifespanInSeconds, Object value)

  • key: Key used to reference the Object
  • lifespanInSeconds: Expiry time in seconds from now
  • value: The java object to store

Get an Object​

CacheManager.getObject(String key, Class<T> clazz)

  • key: Key used to reference the Object
  • clazz: Class of the object for type-casting

Delete an Object​

CacheManager.deleteKey(String key)

  • key: Key used to reference the Object

Clear all Objects​

CacheManager.clearAll()