Guess what is Gocache? a Go cache library. This is an extendable cache library that brings you a lot of features for caching data. Multiple cache stores: actually in memory, redis, or your own custom store. A chain cache: use multiple cache with a priority order (memory then fallback to a redis shared cache for instance) A loadable cache: allow you to call a callback function to put your data back in cache. A metric cache to let you store metrics about your caches usage (hits, miss, set success, set error, ...) A marshaler to automatically marshal/unmarshal your cache values as a struct. Define default values in stores and override them when setting data. Cache invalidation by expiration time and/or using tags. Use of Generics. To begin working with the latest version of gocache, you can import the library in your project.
Features
- A loadable cache: allow you to call a callback function to put your data back in cache
- A metric cache to let you store metrics about your caches usage (hits, miss, set success, set error, ...)
- Multiple cache stores: actually in memory, redis, or your own custom store
- A chain cache: use multiple cache with a priority order (memory then fallback to a redis shared cache for instance)
- Define default values in stores and override them when setting data
- Cache invalidation by expiration time and/or using tags