Machine room

The audit

Every morning every page is opened in a browser at the edge. The result is here.

The daily audit

Every morning every page in both languages is checked: the machine Worker fetches the page and checks the HTTP status and that the shared navigation was inserted (and that no placeholders are left), and a browser at the edge (Browser Run) opens it, counts the key elements (.r12-top, main#indhold, footer.foden), reads any JavaScript errors and takes a picture.

Browser Run is free for a certain number of minutes a day. So only the pages that have changed are opened. The Worker still fetches every page every morning and takes a SHA-256 fingerprint of the HTML; if the fingerprint matches a passed browser check within the last week, that check is reused and the page is marked unchanged. On Mondays every page is opened regardless, so a fault in the Worker or an API cannot hide behind an unchanged page.

If a page fails, it is also written down in the site’s GitHub repo: one issue per day with failures, with the path, the HTTP status and what was missing, and it is closed again when a later audit passes in full. The Workflow calls GitHub’s REST API with a token that may only touch issues in this one repo. Issues from the audit live in the site’s private repository.

The audit is a Workflow in the machine Worker: every page is one step with a pause in between, and every step is idempotent, so a retry never counts a page twice. The screenshots live in R2 and are served through the Worker; the result per page lives in D1, and the finished summary is cached in Workers Cache until the next audit has run.

The family: The defences·The crawlers·The speed·Denmark right now·The archive cabinet·The door·The infrastructure map·The audit·Back to the machine room

Have a useful idea?

Feature requests, bug reports and questions are welcome. Every message gets a personal reply.