生命周期
graph LR
A[请求开始] --> B[第1次调用<br/>真正请求]
B --> C[缓存结果]
C --> D[第2次调用<br/>返回缓存]
C --> E[第3次调用<br/>返回缓存]
C --> F[第N次调用<br/>返回缓存]
F --> G[请求结束]
G --> H[缓存销毁]
style B fill:#f99,stroke:#333,stroke-width:2px
style D fill:#9f9,stroke:#333,stroke-width:2px
style E fill:#9f9,stroke:#333,stroke-width:2px
style F fill:#9f9,stroke:#333,stroke-width:2px
style H fill:#999,stroke:#333,stroke-width:2px
关键点:
- ✅ 缓存只在单次请求内有效
- ✅ 请求结束后,缓存自动销毁
- ✅ 下一个用户的请求会重新开始