#Too many requests after revalidate path

1 messages · Page 1 of 1 (latest)

azure valleyBOT
#

Hi @obtuse socket. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, it seems like you're experiencing an issue with the revalidatePath function in Next.js. This function is used to invalidate the client-side cache and revalidate the data cache on the next page visit.

However, it's important to note that revalidatePath should be called with the page's pathname, not the URL. For example, if you're trying to revalidate a dynamic route, you should use the format /profile/[id] instead of /profile/2.

Here's an example of how to use revalidatePath:

import { revalidatePath } from 'next/cache'
 
revalidatePath('/profile/[id]', 'layout')

This will purge the Client-side Router Cache, and revalidate the Data Cache on the next page visit.

If you're still experiencing issues, it might be helpful to check the Next.js GitHub issues (https://github.com/vercel/next.js/issues) for similar problems or the Next.js documentation (https://nextjs.org/docs) for more information on revalidatePath and caching.

Sources:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@obtuse socket kapa.ai is still learning and improving, please let us know how it did by reacting below

obtuse socket
#

no i'm not revalidatin dynamic route m reavalidation profile route from profile/id dynamic route

obtuse socket