Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some much-needed features about caching #232

Open
zyz954489346 opened this issue Nov 1, 2023 · 1 comment
Open

Some much-needed features about caching #232

zyz954489346 opened this issue Nov 1, 2023 · 1 comment

Comments

@zyz954489346
Copy link

Functions needed and reasons:

  1. For mongodb mode, support for change cache default collection is required, Do not disallow modification of shaker_locks and shaker_cache collections.
    Because in actual scenarios, different data may be cached in different collections, which may avoid too much data in a single table.
  2. Decorator api needs to support custom configuration namespace, default file path will cause project migration or function location movement to cause cache invalidation

Hope to support these features as soon as possible.

@amol-
Copy link
Collaborator

amol- commented Nov 4, 2023

Hi, you can setup different namespaces with mongodb in different databases, that should solve having too many keys in the same collection. Just name the databases like cache1_db, cache2_db and so on... You can set the db name in the connection url.

For the custom namespace of the decorator, providing a PR should be fairly simple if you want to contribute it. You probably just need to add an argument to https://github.com/bbangert/beaker/blob/c089668e6ebb92c6d813ce731ea3b676e0024b7a/beaker/cache.py#L545C5-L545C20 and test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants