cached icon indicating copy to clipboard operation
cached copied to clipboard

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

Open hcldan opened this issue 1 year ago • 4 comments

For instance, after reading a config file.

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

hcldan avatar Feb 19 '24 15:02 hcldan

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

omid avatar Feb 22 '24 07:02 omid

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

jaemk avatar Feb 22 '24 12:02 jaemk

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.

hcldan avatar Mar 05 '24 17:03 hcldan

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.

hcldan avatar Mar 05 '24 17:03 hcldan