Skip to content

CCache v0.0.1

Choose a tag to compare

@GtechGovind GtechGovind released this 22 Nov 12:14
· 8 commits to master since this release

Changelog

Added

  • Initial release of CCache, an in-memory, thread-safe, key-value cache.
  • Eviction Policies: Implemented Least Recently Used (LRU) eviction when the cache exceeds the specified maximum size (max_size).
  • TTL (Time-To-Live): Cache entries expire after a specified time (ttl_millis), automatically evicting expired entries.
  • with_cache Method: Added a method that retrieves cached data or computes and caches the result if not already stored, optimizing redundant calculations.
  • Callback Functions:
    • Eviction Callback: Invoked when an item is evicted from the cache.
    • Logging Callback: Allows custom logging of cache operations (GET, PUT, EVICT, etc.).
  • Thread Safety: Added std::shared_mutex to ensure safe concurrent access to the cache.
  • Versioning: Added versioning support with CCACHE_VERSION_MAJOR, CCACHE_VERSION_MINOR, and CCACHE_VERSION_PATCH constants.