Deferred Static Generation #33218
Replies: 9 comments 36 replies
-
DSG is amazing! I think it will greatly decrease my building times. However, I'm not using Thanks! |
Beta Was this translation helpful? Give feedback.
-
Is there a way to regenerate page after some time or using api call again? |
Beta Was this translation helpful? Give feedback.
-
While giving Gatsby 4 a spin using I've set my codebase https://github.com/laurenskling/using-gatsby-source-graphql to defer rendering the Example on Gatsby Cloud: https://build-58701a40-9907-423a-9f26-9f80e4b3beea.gtsb.io/ZmlsbXM6Mg== Saying: Cannot query field "swapi" on type "Query". So the entire external Graphql isn't found. Building and serving locally I do no get this specific error, but another one. I'm getting in my
|
Beta Was this translation helpful? Give feedback.
-
Hello Gatsby, I was trying to use DSG in my project but I couldn't get the performance boost I was hoping and I decided to share my problem with you guys to get some feedback and solutions.
I was giving Gatsby v4 a try and one of my hopes with DSG was to remove this hybrid rendering approach and move all my rendering to the backend for SEO purposes. With this I would be able to remove this I then tried to take the opposite approach to the problem. I started wondering if I could remove the file To me, the ideal solution for this problem would be a mix between SSR and DSG. I would like to write a file Thats it, let me know if you guys have faced a similar problem or if I'm overthinking this problem. Any ideas or suggestions are welcome, thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi Everyone, I'm integrating DSG into pages using a field at Sanity.io that shows the page should use DSG. I'm also using the file API routing solution to generate the pages. Sending the selection of the field from Sanity through GraphQL is fine and Gatsby is reading it, however getting the GraphQL query noticed in the DSG Config is really tripping me up. How do you either:
Here's a working
|
Beta Was this translation helpful? Give feedback.
-
One of the things we were asked when discussing this feature was, "Will this help Gatsby sites scale"? I answered yes. But I also miss understood a key aspect to the feature. When DSG was finally released it was released and we were told it maintained "atomic builds". This means the only performance savings are the "query running & page generation & upload time" (from kyle on the WPGQL slack). Because DSG doesn't fetch data from the data source at render time it must still be synced at build time leading scenarios like this: My answer is now no/sometimes. Not sure the best way to solve this, but it sure would be nice if DSG could benefit sites with large datasets. |
Beta Was this translation helpful? Give feedback.
-
I would like to use DSG to speed up build times however I'm confused about exactly how it works. When the page is being built with DSG does the build server go back to my WordPress GraphQL endpoint and fetch the data or does it just get it from the cached Gatsby data layer? In other words, if I use DSG for every page, is |
Beta Was this translation helpful? Give feedback.
-
Is it possible to somehow invalidate the cache after a periodic time interval? For example a page that displays the current day's weather could be rendered using DSG instead of SSR but should be regenerated on every request after midnight. Did somebody do something like this before or do you just use SSR or call the weather Api from the client for such use cases? |
Beta Was this translation helpful? Give feedback.
-
Hi 👋 This is less of a question and more of a feature request, but it would be great to make Our use-case:
We ended up using |
Beta Was this translation helpful? Give feedback.
-
As the title suggests, Deferred Static Generation is conceptually very similar to SSG. The only difference with Deferred Static Generation is developers can choose to defer building certain pages until the first time a user requests it. Deferred Static Generation gives developers greater control over their site’s build times.
As this is a new feature available in Gatsby 4, we're eager to hear about your experiences and use cases where you apply DSG in your Gatsby projects. Please share your questions and findings below!
Read all about Deferred Static Generation here
Thank you for building with Gatsby! 💜
Beta Was this translation helpful? Give feedback.
All reactions