Skip to main content

ssr_generation_middleware

Function ssr_generation_middleware 

Source
pub(crate) async fn ssr_generation_middleware(
    req: Request,
    next: Next,
) -> Response
Expand description

Axum 中间件:把当前 SSR 全局世代号注入请求扩展,并对 GET 请求的响应附加 X-SSR-Generation 头。世代号同时保护应用 HTML 缓存,阻止失效前的在途响应回填。