lolly/docs/config/caching/AGENTS.md
xfy 4562dd5a7d docs: 添加子目录 AGENTS.md 文档
deepinit 生成的子目录级 AGENTS.md 文件,帮助 AI agents 理解各功能模块:
- docs/config/: advanced, basic, caching, load-balancing, lua, rewriting, security, ssl
- docs/lua/: api-gateway, authentication, caching, dynamic-routing, logging-monitoring, middleware, rate-limiting, websocket

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 10:35:49 +08:00

41 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-04-23 | Updated: 2026-04-23 -->
# caching
## Purpose
缓存配置示例目录包含代理缓存、Gzip 压缩、Brotli 压缩等性能优化配置。
## Key Files
| File | Description |
|------|-------------|
| `proxy-cache.conf` | 代理缓存:响应缓存、缓存键、过期策略 |
| `gzip.conf` | Gzip 压缩文本压缩、压缩级别、MIME 类型 |
| `brotli.conf` | Brotli 压缩:更高压缩率、现代浏览器支持 |
## For AI Agents
### Working In This Directory
- 代理缓存适用于后端响应不频繁变化的场景
- Gzip 是通用压缩方案,所有浏览器支持
- Brotli 压缩率更高,但需要浏览器支持
- 压缩级别建议 4-6平衡 CPU 和压缩率
### Testing Requirements
- 缓存配置通过集成测试验证
- 压缩测试验证 Content-Encoding 头
### Common Patterns
- 缓存键:`$scheme$host$request_uri`
- 缓存控制:`X-Cache-Status`
- 压缩条件:`gzip_types text/plain text/css application/json`
## Dependencies
### Internal
- `../../../internal/cache/` - 文件缓存实现
- `../../../internal/middleware/compression/` - 压缩中间件
<!-- MANUAL: -->