Loader invalidation
Refresh stale #[load] data after mutations by re-running loaders or invalidating cached responses.
Short cache TTL
#[load(cache = "public, max-age=10")]
async fn product_list(_req: &FlowRequest) -> Vec<Product> {
db::products().await
}Private per-user data
#[load(cache = "private, no-store")]
async fn cart(req: &FlowRequest) -> Cart {
cart_for(req.user_id()).await
}After submit: full page navigation
The simplest invalidation — redirect to GET (see PRG pattern). The next SSR run re-executes all loaders.
set_load_cache (runtime)
// After successful mutation in #[server] or enhanced submit client path:
set_load_cache("product_list", "public, max-age=0");FlowExtensions for DB
Use FlowApp::with_extension(\"db\", \"ready\") so loaders know the pool is initialized. See Integrations.