Skip to content

wayhome/tlcache

Repository files navigation

Two Level Local Cache

image

image

Two Level Local Cache

Usage

  • simple use

>>> from tlcache import TLCache >>> cache = TLCache(cache_dir="/tmp/xxxxdir") >>> lst = [] >>> @cache.cache() ... def apppend(): ... lst.append(1) ... return lst >>> append() == [1] >>> append() == [1]

  • cache refresh

>>> with cache.with_refresh(): ... append() == [1, 1] ... append() == [1, 1, 1] >>> append() == [1, 1, 1]

Features

  • Two level cache, first level is memory, and second level is the filesystem

About

Two Level Local Cache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published