If Bungie's API is down or we experience some other error that causes the scheduled front-end build to fail we don't currently indicate to the user that the data they are viewing could be out of date. I'd like to keep as much of the site static as possible for cost savings and performance, but it might be beneficial to look into Eleventy Serverless for server-side rendering of current data. Alternatively, Cloudflare HTMLRewriter could also be used to update the rendered page. Of course, this could be overthinking it and we could just include minimal JS to change style of last updated section if the date is older than an hour.
Two changes were made that should take care of this:
The live data service with the warning banner allows me to update the site without a rebuild, so I can get around the issue where the build fails from Bungie API being down.
Added some JS to display an error message next to the last update time if it's been over two hours since the last refresh, warning users the data is stale.
If Bungie's API is down or we experience some other error that causes the scheduled front-end build to fail we don't currently indicate to the user that the data they are viewing could be out of date. I'd like to keep as much of the site static as possible for cost savings and performance, but it might be beneficial to look into Eleventy Serverless for server-side rendering of current data. Alternatively, Cloudflare HTMLRewriter could also be used to update the rendered page. Of course, this could be overthinking it and we could just include minimal JS to change style of last updated section if the date is older than an hour.