Skip to content
Discussion options

You must be logged in to vote

Your code with getServerSideProps is fine if the data changes a lot or you need it fresh on every visit.

Use getStaticProps + getStaticPaths if your posts don’t update often — Next.js will pre-build the pages at build time, so they load super fast.

Quick rule of thumb:
Blog posts, docs, marketing pages → getStaticProps.
User dashboards, real-time stats → getServerSideProps.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kaiden-araki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants