Skip to content

RFE: Backend bounded application caching with expiry and metrics #5996

Open

Description

@shai-almog

The backend has security-specific stores and caches, but no general bounded application-cache abstraction comparable to the common JVM cache libraries. Applications need predictable expiry, concurrent loading, invalidation, and memory limits without assuming those libraries translate to the native runtime.

Requested capability

  • Provide typed caches with maximum size or weight, expire-after-write/access, and optional per-entry expiry.
  • Define atomic lookup/load behavior, concurrent load deduplication, invalidation, and removal notifications.
  • Integrate hit/miss, load, eviction, and size metrics with the existing backend metrics API.
  • Document lifecycle, loader failure, listener execution, and process-local scope.

Acceptance criteria

  • Concurrent callers do not trigger unintended duplicate loads for the same key.
  • Expiry, size limits, replacement, invalidation, and removal notifications have deterministic tests using a controllable clock.
  • Loader/listener exceptions cannot corrupt the cache or leak request state.
  • The same cache API works on the JVM and packaged native backend, with a documented memory overhead.

Current implementation

Validate behavior on the JVM and locally on the packaged ParparVM backend where applicable. This request does not call for native-image or GraalVM CI jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions