getStaticProps is evaluated at build time, so it's for static content. getServerSideProps is evaluated every time the page is loaded, so it's for dynamic content.
NextJS edge middleware gives you this functionality. All authorization happens in the middleware and your page static renders as usual with getStaticProps. The middleware can prevent access to the static page.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi! 👋
getStaticProps
is evaluated at build time, so it's for static content.getServerSideProps
is evaluated every time the page is loaded, so it's for dynamic content.Here's a good introduction on data fetching from the Next.js docs. I also found this video particularly helpful when I started out with Next.js.
Thanks,
I would definitely check out the video.
NextJS edge middleware gives you this functionality. All authorization happens in the middleware and your page static renders as usual with getStaticProps. The middleware can prevent access to the static page.