hi all! is there a recommended way of handling the...
# announcements
b
hi all! is there a recommended way of handling the case when self-hosted (or any) growthbook service goes down and other services rely on it? the naive solution is to hardcode fallback values in the codebase but is there any other option?
f
We recommend persisting the features JSON in a database or cache system (e.g. Redis) instead of fetching it directly from the GrowthBook API. Then, use webhooks or simple polling to keep the cached copy up to date.
b
thank you, that seems reasonable! we placed aws api gateway in front of the instance but it doesn't persist cache if the instance goes down. we'll probably have to go with the approach you mentioned
f
The features endpoint does send a
stale-if-error
header, which should tell cache layers to serve a stale copy if the back-end goes down. I'm not sure about API Gateway, but I know CDNs like CloudFront support that automatically.
b
hmm didn't know about that. it might work for us then! will take a look