Does a Server Action always invalidate the Router Cache? #78029
Unanswered
yongholeeme
asked this question in
App Router
Replies: 1 comment 6 replies
-
yeah, most cases server action will invalidate the cache and it will make sure you are seeing the latest data, that includes layout. you can isolate the layout so its not affected by the part where the server action occurs. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know that Layouts are cached and reused on navigation. However in some situations, Layout cannot be persisted across routes and doesn't maintain state.
On general navigations, layout is cached and doens't rerendered. However in or after server action on navigation, layout isn't cached and rerendered although the server action doesn't do anything.
Screen.Recording.2025-04-10.at.11.48.21.PM.mov
I'm not sure if this is normal behavior or a bug. If it's the expected behavior, it would be helpful to know where in the official documentation I can find more information.
Beta Was this translation helpful? Give feedback.
All reactions