我注意到有两个不同的项目可以在Django中使用Redis作为缓存
https://github.com/sebleier/django-redis-cache/
https://github.com/niwibe/django-redis
这两个东西中有一个更出名一些,或者更像是标准包吗?我无法决定使用哪一个。
我注意到有两个不同的项目可以在Django中使用Redis作为缓存
https://github.com/sebleier/django-redis-cache/
https://github.com/niwibe/django-redis
这两个东西中有一个更出名一些,或者更像是标准包吗?我无法决定使用哪一个。
我目前正在使用django-redis作为Redis的缓存后端。虽然我到目前为止还没有使用过django-redis-cache,但使我决定使用django-redis的原因如下:
在django-redis文档网站上,您可以找到更多考虑它的原因。根据我目前的经验,我对django-redis感到非常满意。
django-redis
支持 Redis 锁(用于 Celery 很方便)和 RedisNX
命令,但是django-redis-cache
支持get_or_set
方法,并且可能在内部使用NX
来支持add
。两者都支持incr
和decr
,虽然django-redis
文档不是很清楚。我认为django-redis-cache
文档更好,并且更好地遵循 Django 的缓存 API(例如,支持get_or_set
),因此在django-redis-cache
中切换到其他缓存后端可能更容易。django-redis
仅针对大对象进行压缩,而django-redis-cache
支持不同的压缩级别。 - Chrisdjango-redis-cache
有728次星标。现在它有793颗星。django-redis
有737颗星,现在有958颗星。此外,它说"django-redis
正在积极开发中,而django-redis-cache
未被开发"。 - Niko Pasanen