Caching plugin for fastack
Project description
fastack-cache
fastack-cache is a caching plugin for fastack ❤️
This plugin is inspired by the django cache framework and django-redis!
Supported cache backend:
- Redis:
fastack_cache.backends.redis.RedisBackend
- Sync versionfastack_cache.backends.aioredis.AioRedisBackend
- Async version
Installation
pip install -U fastack-cache
Usage
Add the plugin to your project configuration:
PLUGINS = [
"fastack_cache",
...
]
Configuration:
REDIS_HOST = "localhost"
REDIS_PORT = 6900
REDIS_DB = 0
CACHES = {
# cache name
"default": {
# cache backend
"BACKEND": "fastack_cache.backends.redis.RedisBackend",
# Cache options to be passed to the Redis(...) class
"OPTIONS": {
"host": REDIS_HOST,
"port": REDIS_PORT,
"db": REDIS_DB,
},
# Serializer for converting data into cache
"SERIALIZER": {
"CLASS": "fastack_cache.serializers.JSONSerializer",
"OPTIONS": {
# Option to pass when dumps() method in serializer class is called
"DUMPS": {},
# Option to pass when loads() method in serializer class is called
"LOADS": {}
}
}
}
}
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
fastack-cache-1.2.0.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file fastack-cache-1.2.0.tar.gz
.
File metadata
- Download URL: fastack-cache-1.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.2 Linux/5.11.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a09d8d3332a806c38acb301ee661b10bf8d7d8f95d77f90f69b2e0fc4b230af |
|
MD5 | 93629f33302359a3612210433dabbd3a |
|
BLAKE2b-256 | a7f8bd8da77464be5a9cc2a8224a501d2d68b26521e87b4d561fba9b81deb3d3 |
File details
Details for the file fastack_cache-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: fastack_cache-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.2 Linux/5.11.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1e00fdfa4511ab357940c05b8899b8348261f02f7008ac027a8299a1ca42627 |
|
MD5 | 38db70ad20dc7ea3f785631f1c1ff945 |
|
BLAKE2b-256 | f1089bded839f2fc98605f6182403a5183ccdef6a327789b50f5ce3cd2d1e448 |