Skip to content
Discussion options

You must be logged in to vote

(Note that these are my opinions and others may have different situations on when to use what)

If the data that is displayed to the user changes frequently, and it's important that the user see the most up-to-date data (like a dashboard), then you should use getServerSideProps (fetches the API data on each request) or send the request from the client-side. Fetching from the client vs server is a smaller distinction and the best option may vary depending on the use case. Do consider that if you use getServerSideProps to fetch the API but your API server goes down, then the page will no longer be able to be served since the page will fail to build.

However, for "when you want to serve HTML …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@devinekadeni
Comment options

@alanqchen
Comment options

@ghost
Comment options

@alanqchen
Comment options

Answer selected by devinekadeni
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
2 participants