Support Forums

GATSBY server-side render

HELLO there, so im learning how to use GATSBY and i came across an article from GATSBY itself about server side render, and so it says that it will automatically deploy server side render at build time, so when we do the gatsby build command it will create the server side render by itself, so i dont have to code anything about this?

so can you please explain me if this is truth, if not ye …explain me?

Hi @lenguaestudiocreativ,

I’m not sure what you mean. You’d have to write code specifically to manage server side rendering. Nothing would be automatic. However, if you can avoid SSR, I’d suggest to do so as it will bring down the speed of the website.

so how can i get the 200 status for my files in the browser using gatsby? by the way this is the gatsby article https://www.gatsbyjs.com/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/#why-server-side-render

Hi @lenguaestudiocreativ,

I think the page is talking about rendering pages during build time - the final output is not server side rendered. It’s still static.

I’m still confused about what you mean by this:

Gatsby is a static site generator. You build the site, you deploy it to Netlify and you’d get a 200 for a path that exists. Is that your question?

yeah im confused about getting the 200 status on the control headers in the browser, i did a custom website think you saw it before https://loving-morse-5ebf27.netlify.app/index.html , and i couldnt find the way, which brought me to GATSBY, so your saying that once i uploaded it to netlify through gatsby ill get the 200 status on all the files?

Hi @lenguaestudiocreativ,

I think there’s some kind of a confusion about concepts here. 200 status has nothing to do with Netlify, Gatsby or anything. It’s just a HTTP status code which says that the response was “okay”. It existed well before Netlify or Gatsby existed and will continue to exist for quite a lot of time.

If your files exist and the server is able to send the files upon request, you’d get a 200 status code, irrespective of whether you use Gatsby, some other framework or manually code your entire website. So, using Gatsby is not a blanket to protect you from non-200 status codes, and just to add to that, you probably don’t want a 200 status code in all situations.

200 - Ok
301 - Redirected
304 - Not modified
401 - Unauthorized
404 - Not found

and many many more… Those are just the most common ones when building static websites, each of them is important and serves a purpose.

1 Like