cattle_grid.extensions.examples.cache
This cache stores objects temporally in a key value database
Sample configuration
cattle_grid.toml
[[extensions]]
module = "cattle_grid.extensions.examples.cache"
lookup_order = 4
config = { connection_url = "redis://cattle_grid_redis", duration = 3600 }
The duration is expressed in seconds. By using the special
connection_url :memory:
the cache will be replaced by
fakeredis.
This means that the cache is in memory and no external key value
database is necessary. This is useful for testing, but not
recommended for production use.
config
dependencies
CacheConfig
module-attribute
CacheConfig = Annotated[
CacheConfiguration, Depends(get_config)
]
The configuration object passed when instantiating the extension