Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-cache-machine and Redis

I'm trying to use django-cache-machine to cache queries within my application, but I want to use Redis as a backend. The docs don't really explain how to do this, yet the repository is filled with Redis references, so I'm pretty sure it's possible. I want to make sure I do it right though, so I'm wondering if anyone has any experience with configuring this and maybe more importantly, knows if there are any caveats?

like image 624
acjay Avatar asked Dec 19 '25 20:12

acjay


1 Answers

In your settings set:

CACHE_MACHINE_USE_REDIS = True

REDIS_BACKEND = redis://127.0.0.1:6379?socket_timeout=0.1

https://github.com/jbalogh/django-cache-machine/blob/master/caching/invalidation.py#L187 https://github.com/jbalogh/django-cache-machine/blob/master/caching/invalidation.py#L213

like image 179
jasonthomas Avatar answered Dec 22 '25 00:12

jasonthomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!