WIP
Project description
fastack-cache
fastack-cache is a caching plugin for fastack ❤️
This plugin is inspired by the django cache framework and django-redis!
Currently only supports redis
as cache backend.
And the plan in the future there will be aioredis
and memcached
as cache backends!
Installation
pip install 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.RedisCache",
# 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-0.2.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for fastack_cache-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d7cca757e4c8d639dddcee8b4be0985e1bc019c4e8ef405467cb507780a5b4e |
|
MD5 | 88c8f60adeee94b0075dd4cc0b71d6f5 |
|
BLAKE2b-256 | 692e0a587413c5be30ffb5772d576059e89a45ea9b827abf5cc83c265728f223 |