Multi Layer Cache
- Vorherrschende Sprache
- Python
- Sterne
- 1.4k
- Forks
- 181
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi folks!
Could be possible implement a multi layer cache? example:
0) 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"
}
}
]
```
1) cache.set("key", "value") / cache.delete("key")
1.1) cache will execute function to all layers
2) cache.get("key")
2.1) a `for 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
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.