I'm building an eCommerce website using Next.js. Everything loads and navigates correctly when browsing categories or product pages using links. However, I'm running into an issue when using the browser's back button (e.g., Chrome).
When I navigate forward to a product or category page, it renders as expected. But when I hit the back button, while the URL in the address bar updates correctly to the previous route, the page content does not update — it stays stuck on the most recent view.
I'm using dynamic routes like /product_category/[slug] and client-side navigation with next/link or router.push. My components rely on useRouter and router.query to fetch data based on the slug.
Is this a common issue in Next.js routing? How can I make sure the page content updates properly when navigating backward?