#4772·leptos

leptos_axum: 同时重新生成 `SsrMode::Static` 路由可能会将一个渲染的正文与另一个渲染的头部进行服务

作者: AlexeyMatskevich创建于 2026年6月10日更新于 2026年6月30日
标签bug

Leptos Dependencies

toml
leptos = { version = "0.8.19", features = ["ssr"] }
leptos_axum = "0.8"            # resolves to 0.8.9
leptos_meta = { version = "0.8", features = ["ssr"] }
leptos_router = { version = "0.8", features = ["ssr"] }
axum = "0.8"
tokio = { version = "1", features = ["macros", "rt", "fs"] }
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
futures = "0.3"

To Reproduce

A SsrMode::Static route stamps a fresh epoch number into both the body and an x-render-epoch header on every render. If body and headers always came from one render, the two values would match in every response. The test fires 16 concurrent first requests at the route without pre-generating it, so they all take the on-demand regeneration branch:

内容来源: leptos-rs/leptos