Package is.galia.cache


package is.galia.cache

Package relating to all aspects of caching of images and their characteristics.

There are three main kinds of caches:

  • Variant caches cache post-processed (variant) images.
  • Info caches cache image information.
  • The heap info cache caches image information in the heap, and may be used either on its own, or as a faster "level 1" cache in front of a "level 2" info cache.

Clients are encouraged to use a CacheFacade to simplify interactions with the caching architecture.

Writing Custom Caches

Custom variant caches must implement VariantCache. A single instance of the cache will be shared across threads, so implementations must be thread-safe.

Custom caches are auto-detected using ServiceLoader. Their JAR must include a file named Cache inside resources/META-INF/services containing the fully qualified class name of the implementation. Also, any references to the implementation from the configuration file or delegate must use the fully qualified class name.