nextjs caching , middleware problem
Answered
Cape lion posted this in #help-forum
Cape lionOP
Answered by fuma
On the client side, there's a [router cache](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-caching) provided by Next.js. You can't kick the user out of your app because there's no request being sent to your server.
As an alternative, consider checking if the user is blocked on the client side periodically, and logout if the user has been blocked. Otherwise, just don't do anything, your middleware can block the requests that sent to your API endpoints too.
If you really want it to be instantly, use a real-time messaging solution instead
As an alternative, consider checking if the user is blocked on the client side periodically, and logout if the user has been blocked. Otherwise, just don't do anything, your middleware can block the requests that sent to your API endpoints too.
If you really want it to be instantly, use a real-time messaging solution instead
3 Replies
On the client side, there's a [router cache](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-caching) provided by Next.js. You can't kick the user out of your app because there's no request being sent to your server.
As an alternative, consider checking if the user is blocked on the client side periodically, and logout if the user has been blocked. Otherwise, just don't do anything, your middleware can block the requests that sent to your API endpoints too.
If you really want it to be instantly, use a real-time messaging solution instead
As an alternative, consider checking if the user is blocked on the client side periodically, and logout if the user has been blocked. Otherwise, just don't do anything, your middleware can block the requests that sent to your API endpoints too.
If you really want it to be instantly, use a real-time messaging solution instead
Answer
Cape lionOP
Well thanks i better put validation on api for blacklisted user so he never be able to get any protected api of he blacklist
btw if your problem has been solved, you can mark my answer as the solution 
