bigcache icon indicating copy to clipboard operation
bigcache copied to clipboard

Add ResetKeyMetadata method to resets per-key metadata.

Open askomorokhov opened this issue 4 months ago • 0 comments

Add ResetKeyMetadata Method to Clear Per-Key Request Counts This PR introduces a ResetKeyMetadata method to BigCache, allowing users to reset per-key metadata such as request counts. Similar to the existing Reset and ResetStats methods, ResetKeyMetadata helps clean up accumulated request statistics without affecting cached entries.

This is useful for applications that need to periodically clear usage metrics while retaining cache data.

Summary of changes:

  • Added BigCache.ResetKeyMetadata() and cacheShard.resetKeyMetadata() to clear per-key request counts.
  • Ensures thread safety by locking shards during reset.

askomorokhov avatar Sep 10 '25 13:09 askomorokhov