Next.js Discord

Discord Forum

performance issue with auth supabase-ssr

Unanswered
Ragdoll posted this in #help-forum
Open in Discord
RagdollOP
is there a better way to do this ? i dont want to make a requests to supabase for every time my middleware executes

2 Replies

@Ragdoll is there a better way to do this ? i dont want to make a requests to supabase for every time my middleware executes
middleware isn't meant for db fetches. dont do any long-running task in the middleware. create wrapper function instead and wrap each page.jsx or call utility function in each page.jsx