-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby-source-hackernews] Does it need to rebuild everytime for new posts? #4202
Comments
if i understand you correctly i would say you would need to have some more dynamic parts which fetch content on reload or whenever you want or, if it's not updating too often you could just build the whole thing statically and pull every now and then to check if there is anything new which you could then fetch if necessary or you could have the whole thing rebuild automatically by a CI server on git push or similar so it'll just rebuild everything without the need for dynamic and continuous polling hope my gibberish helps in any way ^^ |
The actual files that are generated are only regenerated on build. data can be refreshed or gotten new from the client as with any web site. If you're building a HN clone, I'd just setup your CI to rebuild the site every 5-10 minutes or so the static data is fresh. |
@KyleAMathews That is the answer I was looking for. Thank you, I'm closing this issue! P.S It would really help if you could share some guide on doing that. (I use netlify currently) |
@ajayns Seems to me like you need to write a script that uses Netlify API to trigger a deploy. Then you need to run that script every 5-10 minutes, or whatever time you need in order to keep it fresh. |
Any ressources/tutorials regarding automatic scheduled deploys on netlify ?? |
I was recently working with
gatsby-source-hackernews
plugin and I realized that all the data is queried on build and it's used as nodes in Gatsby. So for a deployment, which is supposed to update each time on reload, to show new posts, what is the method to be followed?Or when it's called static does it mean it's not supposed to update?
The text was updated successfully, but these errors were encountered: