3 ms·
Yup, it pulls stuff in ahead of time. That said, that's just for the initial render. Once things are mounted and "static" can take advantage of apollo or whatev
by sibeliuss 8y ago
Yup, it pulls stuff in ahead of time. That said, that's just for the initial render. Once things are mounted and "static" can take advantage of apollo or whatever request lib you'd like for "dynamic" content. But the idea is to build out most paths in the build phase and then push up. A lot of the time thats all a site will need. It works amazingly well, at least with Gatsby.
- ralala 8y agoSo there is no server-side rendering of content? Will Google index this correctly?
- sibeliuss 8y agoThe way Gatsby works is during the build phase it will take every path it can through your app _as if_ it was an SSR app, and compile flat html files out of that. So by the time it gets to your server it's remarkably SEO friendly.
- ainu011 8y agoNot only that but it is super fast giving you the edge in in that are of page ranking factors as well.
- cpeterso 8y agoHow is that different from a regular single-page application? My understanding of JAM from watching [1] was that your entire site is static, except for JS that calls out to serverless APIs to CRUD your content on the backend or initiate some workflow with a third-party service like PayPal or Twilio. If your site allows user comments, then you would rebuild your static site every time the user comment is submitted instead of rendering the comments on the server when handling the request. [1] https://www.youtube.com/watch?v=grSxHfGoaeg https://www.youtube.com/watch?v=grSxHfGoaeg Google's HTTP 203 show about JAM stack [2] talks about doing sites claiming the do static site rebuilds "every second" and debates whether static site rebuilds would scale for a large site with lots of old content like the BBC or New York Times. [2] https://www.youtube.com/watch?v=QXsWaA3HTHA https://www.youtube.com/watch?v=QXsWaA3HTHA
- lgregg 8y agoStatic Site Generators basically compile the entire site and serve it as static files to a S3 equivalent bucket with the API component which could connect anywhere. There are faster compilers than others (i.e. Hugo, written with Go) that can compile 1000s of pages in a handful of seconds while others are slower comparatively (i.e. Jekyll); I personally like Gatsby[1] since it's Javascript based making it easy for me to understand and debug. There are setups where those builds can be more modular, so in the case of your News Industry example, you can split it up by section or have custom builds with web hooks based on the section that needs to be updated. Comments normally would probably be something like Disqus but I've also seen a demo of a Netlify dev doing a hacky hijack of their forms function which allowed you to approve a comment then re-render based on approved comments. You can also setup a CD system that builds every X seconds/minutes/hours/days/etc. It's just a different way to build websites. I think it's useful for marketing websites but not as helpful when you need a true app. [1] https://www.gatsbyjs.org https://www.gatsbyjs.org, also checkout: https://www.gatsbyjs.org/showcase/ https://www.gatsbyjs.org/showcase/