Skip to content

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: str

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: str

set_data(key, data)

Serialize data and save to Redis.

PARAMETER DESCRIPTION
key

The cache key to store the data.

TYPE: str

data

The data to be stored.

TYPE: DataFrame

RAISES DESCRIPTION
Exception

If failed to save data to Redis.