SlideRuleEarth / sliderule-prov-sys

Provisioning System for Slide Rule clusters
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Use redis as Django cache instead of custom class being used now #105

Closed cugarteblair closed 10 months ago

cugarteblair commented 1 year ago

django-redis package is one possibility:

CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", # Your Redis URL "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } }

test: from django.core.cache import cache

cache.set('test_key', 'test_value', 300) # Set a cache value with a 5-minute expiry value = cache.get('test_key') # Fetch the cache value print(value) # Should print 'test_value'

cugarteblair commented 1 year ago

https://chat.openai.com/share/595bcebd-69c4-45e5-9579-549ee09cf718

cugarteblair commented 10 months ago

This was fixed in v3.3.0