__init__¶
-
RedisCache.
__init__
(use_pickle: bool = None, redis_instance: redis.client.Redis = None, *args, **kwargs)[source]¶ RedisCache by default uses the global Redis instance from
privex.helpers.plugin
.It’s recommended to use
privex.helpers.plugin.configure_redis()
if you need to change any Redis settings, as this will adjust the global settings and re-instantiate the global instance if required.Alternatively, you may pass an instance of
redis.Redis
asredis_instance
, then that will be used instead of the global instance fromget_redis()
- Parameters
use_pickle (bool) – (Default:
True
) Use the built-inpickle
to serialise values before storing in Redis, and un-serialise when loading from Redisredis_instance (redis.Redis) – If this isn’t
None
/False
, then this Redis instance will be used instead of the global one fromget_redis()