Skip to content

Add ability to set maximum size for cache items #1720

@KoenDG

Description

@KoenDG

Tell us more about this new feature.

I'm looking for an option like --cache-items-size-upper-limit taking an amount MiB.

The idea being that I don't want to cache large items, if I know my workloads will frequently load small items, like thumbnails of a video, and far less frequently the potentially several GB video file it represents.

Let's use Amazon Prime Video as an example. People scroll through pages and pages to look for something to watch. Thumbnails get loaded, and as the user goes back and forth, or reloads pages for some reason, having these thumbnails in cache is useful to speed up loading and reduce load on the actual storage.

When the user decides to watch something, adding that several GB file to the cache potentially evicts many thumbnails, if the limit of the cache is reached.

I'm assuming a relatively small storage here.

That's probably not how Amazon Prime Video works internally. I'm using it as a relatable scenario.

My use case for this feature request is: only keep files under a certain size in the cache, and files bigger than that don't get cached, since they're retrieved far less frequently, and would mess up the cache if they were added to the cache.

So in this scenario, maybe I would say "Only files smaller than 1MiB". Someone else might have non-media datasets with related smaller and larger items and say "Only files smaller than 100MiB". Etc...

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