DEV Community

FatimaAlam1234
FatimaAlam1234

Posted on

NextJS - getServerSideProps

Important Properties in context of getServerSideProps
Params -> for dynamic parameters.
request -> to view the request from the client.
response -> to set the response for the client.
query -> to get hold of the query parameter hit in the url.

Image description

What happens at build time?

  1. There is a lambda-symbol against the pages which are server-side-rendered.
  2. This symbol states that this page renders at run-time.
  3. Also there are no json or html files formed in the app during build.
  4. Even after the 1st request the above files are not generated because SSR is basically dependent on run-time requests.
  5. Also the problem of stale data is solved as when we refresh the application, the latest data is fetched without the need for a validate key.

Top comments (0)