Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Two Level Local Cache

Project Description

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

History

0.2.1 (2017-06-21)

  • Fix missing exception stack

0.2.0 (2016-08-07)

  • Even cache when got empty results
  • When exception, use old data to cache degraded

0.1.7 (2016-4-14)

  • cache refresh manager, should be used with lock

0.1.6 (2016-4-14)

  • add cache refresh context manager

0.1.5 (2016-4-14)

  • decrese logging warnings

0.1.4 (2016-3-16)

  • make sure fd is closed when fdopen occus exception
  • set memory before file

0.1.3 (2015-11-24)

  • Don’t cache when results is empty

0.1.2 (2015-11-13)

  • Fix a bug that which causes when cache invalidate wil not cached again.

0.1.1 (2015-11-10)

  • Inside the tlcache’s add method, use the filecache’s set method internally.

0.1.0 (2015-11-10)

  • First release on PyPI.

Release History

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
tlcache-0.2.1.tar.gz
(16.1 kB) Copy SHA256 Hash SHA256
Source None Jun 21, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting