Next.js - Which Data Fetching Method to Use

2 replies
Last updated: Apr 20, 2021
I see that sanity.io is built with Next JS. Which data fetching method are you guys are using? Because all the three methods have limitations of their own
Apr 20, 2021, 7:27 AM
Hi
user R
, we're using a combination of all three on sanity.io depending on the needs of each page. Where we use
getServerSideProps
, we set custom cache headers to not have to compute results on each request. And indeed, we're hosting on Vercel, although the Swag Store is hosted on Netlify.
Apr 20, 2021, 7:43 AM
user M
Are there any docs/tutorials from where I can learn for setting custom cache headers
Apr 20, 2021, 2:14 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in