Files
2025-08-29 16:49:56 +05:00

39 lines
705 B
Python

from config.env import env
CACHES = {
"default": {
"BACKEND": 'django_redis.cache.RedisCache',
"LOCATION": 'redis://redis:6379',
"TIMEOUT": 300,
},
}
CACHE_MIDDLEWARE_SECONDS = 300
CACHEOPS_REDIS = 'redis://redis:6379'
CACHEOPS_DEFAULTS = {
"timeout": 300,
}
CACHEOPS = {
"accounts.*": {
"ops": "all",
"timeout": 60 * 5,
},
'orders.*': {
'ops': 'all',
'timeout': 60 * 5,
},
'products.*': {
'ops': 'all',
'timeout': 60 * 5,
},
'shared.*': {
'ops': 'all',
'timeout': 60 * 5,
}
}
CACHEOPS_DEGRADE_ON_FAILURE = True
CACHEOPS_ENABLED = env.bool('CACHEOPS_ENABLED', False)