CacheStore
A simple in-memory cache.
Usage
CacheStore()Parameters
max_size: int = 100-
Maximum number of entries.
ttl: int = 3600-
Time-to-live in seconds.
Methods
| Name | Description |
|---|---|
| get() | Retrieve a cached value. |
| set() | Store a value in the cache. |
get()
Retrieve a cached value.
Usage
get(key)Parameters
key: str-
The cache key.
Returns
object or None-
The cached value, or None if not found.
set()
Store a value in the cache.
Usage
set(key, value)Parameters
key: str-
The cache key.
value: object-
The value to cache.