jaemk/cached

Feature: Ability to configure (or reconfigure) a SizedCache `size` based on runtime data

hcldan opened this issue · 4 comments

For instance, after reading a config file.

Or an admin wanting to tweak the size of the cache without restart.

You mean a default config for all sized caches or define size by an env var, like size = my_fn_size?

You can access the backing cache store at any time, it's named after the function name by default (FN_WRAPPED_WITH_CACHE). What needs to be added is a method on the sized cache store that lets you modify the cache size

Yes, a method to resize the cache would be great.

It would also be nice if I could specify it from a value that I would read from config on startup.

You mean a default config for all sized caches or define size by an env var, like size = my_fn_size?

No, each cache would likely have its own needs.