I'm working on a Next.js 14 app with several dynamic routes (e.g., /product/[id]) that render product details from a large dataset (around 50k+ records) stored in PostgreSQL.

I'm using getServerSideProps to fetch data for each page:


export async function getServerSideProps({ params }) {
  const product = await db.products.findUnique({
    where: { id: params.id },
    include: { category: true, reviews: true },
  });

  return { props: { product } };
}

0

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.