Skip to main content

Setup normal class to mobio lru cache

Project description

LRU Cache

Thư viện caching của MOBIO. Hỗ trợ cache trên memory hoặc Redis.

Cài đặt:

pip3 install m-caching

Sử dụng:

__store_type = StoreType.REDIS # for redis cache
__store_type = StoreType.LOCAL # for memory cache
__file_config = 'config-file-path'

lru_cache = LruCache(store_type=__store_type, config_file_name=__file_config)

Ignore empty values from cache

__store_type = StoreType.REDIS
__file_config = 'config-file-path'
lru_cache = LruCache(store_type=__store_type, config_file_name=__file_config)
lru_cache.accept_none(False) # => ignore none values

Example config

[REDIS]
host=redis-server
port=6379
expired_time_for_key=1200
expired_time_for_group=86400
number_db_redis = 1
expired_time_reset_password = 3600
expire_t1 = 600
expire_t2 = 1200
cache_prefix=test_cache

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

m-caching-0.1.1.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

m_caching-0.1.1-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

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