# fastack-cache
fastack-cache is a caching plugin for [fastack](https://github.com/fastack-dev/fastack) ❤️
This plugin is inspired by the [django cache framework](https://docs.djangoproject.com/en/4.0/topics/cache/) and [django-redis](https://github.com/jazzband/django-redis)!
Supported cache backend:
* Redis:
* ``fastack_cache.backends.redis.RedisBackend`` - Sync version
* ``fastack_cache.backends.aioredis.AioRedisBackend`` - Async version
# Installation
```
pip install -U fastack-cache
```
# Usage
Add the plugin to your project configuration:
```python
PLUGINS = [
"fastack_cache",
...
]
```
Configuration:
```python
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": {}
}
}
}
}
```
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
最新资源
- springboot项目高校宣讲会管理系统.zip
- springboot项目工作量统计系统.zip
- springboot项目果蔬作物疾病防治系统.zip
- springboot项目共享书角图书借还管理系统.zip
- springboot项目航班进出港管理系统.zip
- springboot项目滑雪场管理系统.zip
- springboot项目基于Hadoop的物品租赁系统的设计与实现 a.zip
- springboot项目基于Java Web的考编论坛网站的设计与实现.zip
- springboot项目基于html+css的在线英语阅读分级平台.zip
- springboot项目基于javaweb的城乡居民基本医疗信息管理系统.zip
- springboot项目基于java的物资综合管理系统的设计与实现.zip
- springboot项目基于javaweb的宠物猫认养系统.zip
- springboot项目基于java的美食信息推荐系统的设计与实现.zip
- springboot项目基于java敬老院管理系统_.zip
- springboot项目基于java的综合小区管理系统.zip
- springboot项目基于java国产动漫网站设计和实现.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈