Repository navigation
Option to opt out of revalidation when setting/deleting cookies in Server Actions #98059
brunorodmoreira
started this conversation in
Ideas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Goals
Non-Goals
Background
Today any
cookies().set()/delete()in a Server Action forces a full page re-render server-side and invalidates client router caches, wasted work when the cookie doesn't affect rendered content (canonical case: refreshing a session cookie on every request). A prior work was already started by a maintainer in #84313 due to a report in https://x.com/madarco/status/1972314852036374833 approved by Guillermo but it's stale since September 2025.Proposal
The same API from #84313:
cookies().set(name, value, { revalidate: false }), object forms, andcookies().delete({ name, revalidate: false }). I already reworked in a brand new PR #98058, usingMutableRequestCookiesAdapterinstead.All reactions