Skip to main content

Caching your data to Redis

Project description

Use Redis as a backend for caching

from redis_cache.cache_manager import CacheManager
from datetime import timedelta
from time import sleep

cache = CacheManager('localhost', port=6379, db=1, expiration=timedelta(days=1))

def sum(a, b):
    sleep(2)
    return a + b

cache('S', sum, 8, 5) # Took 2.1s
cache('S', sum, 8, 5) # Took 1.8ms

Project details


Download files

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

Source Distribution

Python Redis Caching-0.0.6.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

Python_Redis_Caching-0.0.6-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file Python Redis Caching-0.0.6.tar.gz.

File metadata

  • Download URL: Python Redis Caching-0.0.6.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for Python Redis Caching-0.0.6.tar.gz
Algorithm Hash digest
SHA256 bd64ac0f59ecc7f8f10299ca929f96c4b7dedee84abfed38e35d5bbc00b81b73
MD5 cc5131daba0c2a74241893646a20c668
BLAKE2b-256 7b3d44aa90cd8368e9b187ec1116364691c052365b653059a96fd96764a221cb

See more details on using hashes here.

File details

Details for the file Python_Redis_Caching-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for Python_Redis_Caching-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bffc57b79d1e2c3afff15aed70231184eb6b4c490a8ad762ad11dc2e8760bd46
MD5 4456a933e1535a5bcd098adc19939523
BLAKE2b-256 32fd4e08413cf05517ce79d479cb6c52417ca8f13c71a89ece799d33c95cd787

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page