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

Advice needed: Wrap Redis backend with in-memory backend function? #500

Open
gabriels1234 opened this issue Sep 29, 2022 · 1 comment
Open

Comments

@gabriels1234
Copy link

Describe the problem

Using the Redis Backend, and calling config.VARIABLE repeatedly for the many variables slows down the performance ((tested)).

I ask, from a theoretic standpoint:

Is there something to gain from wrapping the calls to constance values with an in-memory cache (e.g get_constance_value(value, cache_ttl)) that will get the value from Redis the first time, and keep it in-memory (e.g. for 60 seconds)?

@horpto
Copy link
Contributor

horpto commented Sep 29, 2022

You can try to use CachingRedisBackend via CONSTANCE_BACKEND = 'constance.backends.redisd.CachingRedisBackend'. See details in docs.

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