https://github.com/digipost/digipost-cache
Caching functionality
https://github.com/digipost/digipost-cache
Last synced: about 2 months ago
JSON representation
Caching functionality
- Host: GitHub
- URL: https://github.com/digipost/digipost-cache
- Owner: digipost
- License: apache-2.0
- Created: 2015-05-08T12:40:54.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T12:39:43.000Z (about 1 year ago)
- Last Synced: 2025-01-29T05:37:52.609Z (4 months ago)
- Language: Java
- Size: 149 KB
- Stars: 0
- Watchers: 22
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Digipost Cache
[](https://maven-badges.herokuapp.com/maven-central/no.digipost/digipost-cache)

[](https://github.com/digipost/digipost-cache/blob/main/LICENCE)Library containing caching functionality used by Digipost projects.
## Feature overview
### In-memory cache
The entry point for creating in-memory caches can be found in the
`no.digipost.cache2.inmemory` package, which wraps the
[Caffeine](https://github.com/ben-manes/caffeine) cache implementation.
In addition to standard key-value cache, this library also offers a
specialized API for caching a shared single object
([```SingleCached```](src/main/java/no/digipost/cache2/inmemory/SingleCached.java)).### Fallback
Digipost Cache also supports a fallback-concept, currently implemented as
storing cache values on the file system. In the event of a cache value
[```Loader```](src/main/java/no/digipost/cache2/loader/Loader.java)
failing (e.g. if it resolves the value over the network or other error-prone I/O),
the last value it successfully loaded will instead be read from a disk-file.
Other ways to store and read values for fallback can be implemented by implementing
[```FallbackKeeper```](src/main/java/no/digipost/cache2/fallback/FallbackKeeper.java)
for storing a value for fallback, and the already mentioned ```Loader``` for
loading an already stored fallback value.