TIMEOUT无法正常工作django-redis-cache

时间:2017-02-02 12:12:53

标签: python django caching redis

我有设置缓存,而我的TIMEOUT无效。我的缓存永远不会更新。

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.cache.RedisCache',
        'LOCATION': 'localhost:6379',
        'TIMEOUT': 5,
        'OPTIONS': {
            "SOCKET_CONNECT_TIMEOUT": 5,  # in seconds
            "SOCKET_TIMEOUT": 5,  # in seconds
            'DB': 1,
            'PASSWORD': '',
            'PARSER_CLASS': 'redis.connection.HiredisParser',
            'PICKLE_VERSION': 2,
        },
    },
}

1 个答案:

答案 0 :(得分:0)

每个人我的问题都已经用django-rest-framework-cache解决了。似乎django-redis-cache无法理解超时。

https://github.com/Onyo/django-rest-framework-cache/blob/master/README.md