-2

I have a next js website for my client and now I added sanity for content management. It’s working fine but it takes a couple of seconds to fetch data and show it on the screen. Before sanity I was using hardcoded data and of course it was working super fast.

I am using getServerSideProps.

Is there a way to make it work faster?

The website is https://engabeauty.no

Marty
  • 21
  • 2
  • Please provide a [mre]. – juliomalves Oct 01 '22 at 18:28
  • you can use `getStaticProps` to fetch data at build time, and add a `revalidate` prop. You may read about it [here](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration) – Ejaz Oct 03 '22 at 10:04

1 Answers1

0

I tried to use getStaticProps instead of getServerSideProps like Ejaz suggested and it works like a charm! The website is again super fast.

Marty
  • 21
  • 2