网页
综合
更新时间 2026-11-06 00:00:00
connection
自动蜘蛛
nextjs.org
正文约 752 字
The connection() function allows you to indicate rendering should wait for an incoming user request before continuing.
It's useful when a component doesn't use Request-time APIs like cookies or headers, but still needs to produce different output per request, such as Math.random() or new Date().
Queries from synchronous database drivers like better-sqlite3 complete during prerendering. If you are not already using Request-time APIs, call connection() before your query to exclude them from prerendering:
Now any component that calls getVisitorCount() will be excluded from prerendering, along with the rest of its output.
Last updated November 6, 2026
Subscribe to our newsletter
Stay updated on new releases and features, guides, and case studies.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。