HTML 原文 · 完整 Markdown · 纯文本 · 分段目录 · ← 上一段 · 下一段 →

02-第 1 层:请求记忆 (Request Memoization)

第 12 / 15 段:生命周期

Next.js 缓存机制全解析 · 发布 2026-02-20 · 更新 2026-11-11 · 标签:Next.js、缓存、前端架构、React

生命周期

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

关键点: