DEV Community

Discussion on: Do I have to rebuild my entire JAMstack site for every new change?

Collapse
 
waylonwalker profile image
Waylon Walker

I like this idea of decoupling dynamic content to prevent too many incremental builds! I do it at work to avoid maintaining hooks into data sources that are tricky to track.

One thing I would like to see is a way of having one source that fetches data from the ssg and refreshes the data client side upon render. We wouldn't want to over fetch every source, but I definitely have some sources I don't route through gatsby because I don't control the changes, and I dont want to maintain the data in two places. Its fast enough to do it client side to I dont worry too much about it.

Collapse
 
shortdiv profile image
Divya

When you say fetches data from the ssg do you mean at build time ?

Collapse
 
waylonwalker profile image
Waylon Walker

Lol yes, not really worded well. 🤣

Thread Thread
 
shortdiv profile image
Divya

All good! Doesn't that setup still mean depending on fast builds for speedy updates on render?

Thread Thread
 
waylonwalker profile image
Waylon Walker

The json is hosted separately, and is live as soon as it's published. The data is fetched live from the client side on render.

I do have a short cache time on it to speed up refreshes, but still allow for near live data. Or use hard refresh to force it to fully refetch.