staleTimes vs stale option in cache profile #82230
-
Don't understand, why in experimental.staleTimes i can differentiate static and dynamic individually, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Let's see, the time has come to start answering questions about these APIs. With the stale option in your This effectively means, that the static/dynamic distinction is not necessary in your mental model. If I stop here, does that answer your question? |
Beta Was this translation helpful? Give feedback.
Yes, if you use no stale value in your profile (undefined), the static staleTime is used, though there's an edge case for the
"seconds"
profile, which uses dynamic. We should document this fallback behavior better.next.js/packages/next/src/server/config.ts
Lines 946 to 957 in 531e938