andromeda icon indicating copy to clipboard operation
andromeda copied to clipboard

Create a generic cache

Open kylecorry31 opened this issue 2 years ago • 0 comments
trafficstars

  • Key
  • Value

Metadata

  • Last accessed time
  • Access count
  • Create time

Strategies

  • Out of space removal strategy
    • Determines which key to prune when out of space
    • Inputs: key being inserted, all valid keys and metadata, target size
    • Output: keys to remove
  • Key selection strategy
    • Given the list of keys and a new key, it returns the key to insert/update
    • Inputs: key being inserted, all valid keys and metadata
    • Output: key to insert/update
  • Expiration strategy
    • Run before any operation on the cache
    • Inputs: key being inserted (if any), all valid keys and metadata
    • Output: keys to remove
  • Storage strategy
    • The backing cache store
    • Operations: get, remove, insert, update, get all keys and metadata

The goal is to replace the geospatial and LRU caches with a single cache.

Another option could be to compose this with wrappers of some sort (ex. SpaceLimitedWrapper, ExpirationWrapper, etc)

kylecorry31 avatar Aug 21 '23 21:08 kylecorry31