Skip to content

Redis Cache

Bases: CacheStrategy

Cache data to Redis as a CSV string

get_data(key)

Return data, settings from cache if exists.

PARAMETER DESCRIPTION
key

The cache key to retrieve the data.

TYPE: str

RETURNS DESCRIPTION
ChartData | None

ChartData or None if not found.

invalidate(key)

Remove data from cache.

PARAMETER DESCRIPTION
key

The cache key to invalidate.

TYPE: str

set_data(key, data)

Serialize and store DataFrame, settings, and column names in Redis.

PARAMETER DESCRIPTION
key

The cache key to store the data.

TYPE: str

data

The ChartData to be stored.

TYPE: ChartData

RAISES DESCRIPTION
Exception

If failed to save data to Redis.