next.js
5d7c41a4 - [Cache Components] Ensure cache misses always cause a restart in dev (#86583)

Commit
24 days ago
[Cache Components] Ensure cache misses always cause a restart in dev (#86583) This PR works around a problem in the restart-on-cache-miss rendering flow where short-lived caches wouldn't be considered dynamic if they managed to fill microtaskily. The problem is that: 1. If a cache fills microtaskily, it won't register as a cache miss, so we won't restart the render 2. The logic for omitting short-lived caches only runs for cache hits (because it expects to run in the final render), so it won't be applied to a cache we just filled The fix implemented here isn't ideal, but fixes the problem -- we just make it so that all caches take at least a task to fill, and thus all cache misses will be "noticed" and cause a restart. This sacrifices the nice property we had before where a microtasky cache miss wouldn't trigger a restart, but we can live with that for now for the sake of correctness.
Author
Parents
Loading