Skip to content

[Feature] Use Moka's Time‑To‑Idle (TTI) instead of the eviction thread in the gateway #15248

@xiaguan

Description

@xiaguan

Checklist

Motivation

If I understand correctly, the current implementation clears all KV‑cache entries after a configured interval.

I think we could leverage Moka's TTI for a more precise eviction policy. For example, with a TTI of five minutes, any KV‑cache entry that hasn’t been accessed (via get or insert) within that period will be automatically removed. This aligns better with what we intend to do. See the example: https://docs.rs/moka/0.12.11/moka/future/struct.Cache.html#example-time-based-expirations

What do you think?

Related resources

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions