mirror of
https://github.com/halo-dev/docs.git
synced 2026-01-13 06:03:55 +08:00
doc: add redis configuration documents (#53)
This commit is contained in:
@@ -116,14 +116,50 @@ halo:
|
||||
|
||||
```yaml
|
||||
halo:
|
||||
# memory or level
|
||||
# memory or level or redis
|
||||
cache: memory
|
||||
```
|
||||
|
||||
目前支持两种策略:
|
||||
目前支持三种策略:
|
||||
|
||||
- `memory` 将数据缓存至内存,重启服务缓存将清空。
|
||||
- `level` 将数据缓存至本地,重启服务不会清空缓存。
|
||||
- `redis` 将数据缓存至 Redis,重启服务不会清空缓存,如需分布式部署 Halo,请选用此种缓存方式。
|
||||
|
||||
**注意事项**:
|
||||
|
||||
- 如果选用 Redis 缓存方式,请在配置文件加入 Redis 相关配置,完整的配置示例如下:
|
||||
|
||||
```yaml
|
||||
server:
|
||||
port: 8090
|
||||
|
||||
# Response data gzip.
|
||||
compression:
|
||||
enabled: true
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
# MySQL database configuration.
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123456
|
||||
redis:
|
||||
# Redis cache configuration.
|
||||
port: 6379
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
password: 123456
|
||||
|
||||
halo:
|
||||
# Your admin client path is https://your-domain/{admin-path}
|
||||
admin-path: admin
|
||||
|
||||
# memory or level or redis
|
||||
cache: redis
|
||||
```
|
||||
|
||||
|
||||
### 压缩
|
||||
|
||||
@@ -171,7 +207,7 @@ halo:
|
||||
# Your admin client path is https://your-domain/{admin-path}
|
||||
admin-path: admin
|
||||
|
||||
# memory or level
|
||||
# memory or level or redis
|
||||
cache: memory
|
||||
```
|
||||
|
||||
@@ -196,7 +232,7 @@ halo:
|
||||
# Your admin client path is https://your-domain/{admin-path}
|
||||
admin-path: admin
|
||||
|
||||
# memory or level
|
||||
# memory or level or redis
|
||||
cache: memory
|
||||
```
|
||||
|
||||
|
||||
@@ -12,3 +12,4 @@ title: 三方指南
|
||||
- [如何在 Windows 下搭建 Halo](https://ykanade.cn/2021/08/11/HaloInWindows/)
|
||||
- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95)
|
||||
- [Windows下搭建halo并配置nginx与SSL](https://blog.shikangsi.cn/archives/halo-windows)
|
||||
- [Linux环境下如何分布式部署Halo](https://luoxx.top/archives/halo-distributed-deploy)
|
||||
Reference in New Issue
Block a user