To clear the cache in Next.js app, follow these steps:
- Stop the development server or any running Next.js processes.
- Locate the root directory of your Next.js project.
- Delete the .next directory. You can do this using the command line or file explorer.
Info: Once the .next directory is deleted, you can start the Next.js development server or rebuild your project, and Next.js will regenerate the necessary cache and build artifacts.
Keep in mind that deleting the .next directory will remove all the cached data and build artifacts, which means Next.js will need to rebuild the project and regenerate the cache on the next build or server start.