Redis Cache
Bases: CacheStrategy
Cache data to Redis as a CSV string
get_data(key)
Return data from cache if exists.
PARAMETER | DESCRIPTION |
---|---|
key |
The cache key to retrieve the data.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame | None
|
The data if exists, otherwise None. |
invalidate(key)
Remove data from cache.
PARAMETER | DESCRIPTION |
---|---|
key |
The cache key to invalidate.
TYPE:
|
set_data(key, data)
Serialize data and save to Redis.
PARAMETER | DESCRIPTION |
---|---|
key |
The cache key to store the data.
TYPE:
|
data |
The data to be stored.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
Exception
|
If failed to save data to Redis. |