middleware executed multiple times
Unanswered
Youssef posted this in #help-forum
YoussefOP
Is it okay that the middleware function runs about 10 times every refresh during development?
I'm just doing a single fetch inside of it
And does next.js cache requests inside middleware?
I'm just doing a single fetch inside of it
And does next.js cache requests inside middleware?
export async function middleware(request: NextRequest) {
const response = await fetch("my API");
...
console.log("Runnning") // This log shows up about 10 times in the console
}1 Reply
YoussefOP
Anyone?