天天看点

Python:缓存库mo-cache支持内存、文件、RedisMo-Cache

Mo-Cache

Github:

https://github.com/mouday/Mo-Cache

a simple cache lib support memory、file、redis

install

pip install mo-cache      

demo

from mo_cache import cache_decorator

cache = cache_decorator('memory')

@cache
def foo(a, b):
    return a + b

if __name__ == '__main__':
    foo()