Skip to content

Implement cache maintenance policy #12

@peterhuene

Description

@peterhuene

Currently the cache directory growth is unbounded and garbage (i.e. cached content not referenced from a cached response) isn't collected.

The default cache storage implementation should take configuration relating to how large the cache should grow to (in terms of bytes) and how often garbage collection should be performed. The maximum size default might be 100 MiB.

We'll need a new advisory lock at the root of the cache, like <dir>/v1/.lock to coordinate operations against the entire cache. Storage should take a shared lock on this file during normal operation.

Occasionally (by a mechanism TBD), a garbage collection should occur upon which an exclusive lock on the cache is acquired and garbage should be collected. It should then determine if the size of the cache is still exceeding the maximum.

If the cache is still above the maximum, it should consider a trade-off between deleting the largest stored content with the least-recently-accessed requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions