#Disable prefetch for specific page
1 messages · Page 1 of 1 (latest)
Hi @thick knoll. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
I'm sorry, but the knowledge sources do not mention a built-in way to globally disable prefetching for a specific route or page in Next.js. The documented approach is to set prefetch={false} on each <Link /> that points to the route you want to exclude from prefetching, such as /logout Next.js Link prefetch (App Router) Next.js Link prefetch (Pages Router).
If you want to ensure prefetching is disabled for a specific route everywhere, you would need to consistently add prefetch={false} to all <Link /> components targeting that route. There is no configuration or API in the provided documentation that allows you to set this globally for a specific path.
If you want to avoid this repetition, you could create a custom Link component that automatically sets prefetch={false} for certain routes, but this pattern is not described in the official documentation or knowledge sources.