r/statichosting • u/xxmaskx • 6d ago
How do you keep static builds consistent when content comes from multiple apis?
I’ve been thinking about a static site that pulls content from a cms, pricing from one api, and product data from another. Incremental builds seem messy. One product changes, but category pages, search indexes, related-product sections, or the homepage might still be using older data. Deletes seem even trickier. If something disappears from the cms, how do you make sure every page referencing it gets invalidated? And if an api fails mid-build, do you keep the old page, fail the deploy, or use cached data? Curious how people handle this without incremental builds slowly turning into full rebuilds anyway.
1
u/kelkes 6d ago
If the page is smallish i will just rebuild the whole thing.
1
u/ZosoRules1 6d ago
I build the page as a standalone HTML without calling any APIs.
1
u/AdvertisingOwn9464 5d ago
i often treat the build as a single snapshot of all apis. content changes trigger webhook based invalidation and a dependency map determines which pages need rebuilding. so if an api fails, Id rather keep the last successful deploy than ship a partially updated site. incremental builds stay manageable when invalidation is entity based and not page based.
1
u/northboundish 5d ago
i’d keep a last known good data snapshot and track dependencies between content and generated pages. that way, updates and deletes can trigger the right rebuilds. if an API fails, using cached data temporarily seems safer than publishing incomplete pages.
1
u/sourraine 11h ago
i do full build rather than spend too much time managing dependencies between pages. id also keep a last-known-good copy of api data so a temporary outage doesnt leave the build with half-updated content