-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Labels
Description
Hi folks!
Could be possible implement a multi layer cache? example:
- creating the cache:
'cache': [
{
'cache': "aiocache.SimpleMemoryCache",
'serializer': {
'class': "aiocache.serializers.StringSerializer"
}
},
{
'cache': "aiocache.RedisCache",
'endpoint': "127.0.0.1",
'port': 6379,
'timeout': 1,
'serializer': {
'class': "aiocache.serializers.PickleSerializer"
}
}
]
-
cache.set("key", "value") / cache.delete("key")
1.1) cache will execute function to all layers -
cache.get("key")
2.1) afor i in layers:
will check what's the first cache that have this data
2.2) if it's not the first layer and data was found, update from current layer to first layer
why? the idea is have a memory cache with less cached items than the redis cache, and when it's not found on local memory check redis value