Next.js Discord

Discord Forum

Can you use the cache function from react in middleware?

Unanswered
Magnificent Hummingbird posted this in #help-forum
Open in Discord
Magnificent HummingbirdOP
I have an async function that I want to call in my middleware, but I want it to be deduped, so run only once per request. Is using the cache function from react going to achieve that?

Thanks!

0 Replies