Skip to content
Discussion options

You must be logged in to vote

Great question!

🔹 getStaticProps: Runs at build time. It pre-generates the page as static HTML. It’s perfect for content that doesn’t change often — like blog posts or marketing pages.

🔹 getServerSideProps: Runs on every request. It generates the page at runtime. Use it when the data is dynamic or depends on the request (e.g., user session, query params).

💡 Pro Tip: Use getStaticProps + revalidate (ISR) if you want to serve static content that can also update in the background!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by arverse-u
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants