Is there a way to tell middleware that a page (App Router) is visited via client-side navigation?
Answered
Rough harvester ant posted this in #help-forum
Rough harvester antOP
Context:
In middleware, we’re doing auth checks, and this is an “expensive†process that ideally should only be called during a hard page visit. So we want to skip calling this middleware when a page is visited via client-side navigation. The
In middleware, we’re doing auth checks, and this is an “expensive†process that ideally should only be called during a hard page visit. So we want to skip calling this middleware when a page is visited via client-side navigation. The
next.config.js skipMiddlewareUrlNormalize doesn’t seem to be doing anything on app router.