ibrahimyaacobI
Convex Community12mo ago
19 replies
ibrahimyaacob

middleware is slowing down NextJS page render

after few hours of debugging, i finally figured out why my Next app page navigation is slow (doesnt instantly navigate when clicking <Link/>).

It was the
convexAuth.isAuthneticated()
function is triggered on every page navigation. I know it was the function because when i remove the line, my page navigates to the new path instantly and i dont have that
auth:isAuthenticated
log in convex.

so the question is how do i optimize it ??
our user complains a lot on this, saying our app is super sluggish.
image.png
image.png
Was this page helpful?