Next.js · Senior · Question 75 of 75
With Cache Components, when is connection() still the right choice over io()?
- ✓Correct answer: When the code must wait for a real user request, e.g. reading runtime-only environment values - it also blocks prefetching
- 2Always -
io()is deprecated - 3When reading
new Date()
Explanation
io() suspends like any async call, so the code after it can still be cached and prefetched. connection() stays suspended until a navigation reaches the server.