static-site-geo-962
Discussion #962: a static site's page script can learn the visitor's country, so carloku.com/pricing can default its currency.
What changes
- Every site the edge serves answers
GET/HEAD /.carlos/geoitself:{"country":"IE","source":"DBIP-City-Lite"}, or bothnullwhen unknown. Other methods get 405 (Allow: GET, HEAD). - Same answer as the
X-Carlos-Geo-*headers (#241): the request's one geo answer fromdecideGeo, adopted from a verified hop or a tunnel, null on a rejected hop, a door call, or with no database. There is no per-app switch (geoip spec R4), so "geo off" = no database = null. - Answered by the box that serves the route, after the routing checks (backhaul, HA forwards, door scope, import gate, lapse) and before the meter, observer, guard, password gate, asset catch, page cache and LRU. Never billed, counted in analytics or filed as a request record, like the edge's other own answers (lb-health, steering probe, HA control).
Cache-Control: no-store, private,Vary: *,nosniff, no cookie. The far asset catch skips the path whatever prefix an app declares. Demos answer it through the demo response policy (Cache-Control becomes itsno-store).- Shadowing: the path is reserved in every spelling that cleans to it; a site's own file or an app's route there is never served. A linked (pinned) request goes on to its app.
- Docs: a short section in docs/site/cli.md, "The visitor's country in a static page". Copy awaits Paul's review.
Tests and review
- internal/edge/geoanswer_test.go plus HA ingress: static and app sites with the MaxMind test database, no database, unplaced address, methods, never cached (page cache, asset store, LRU), not counted, custom and wildcard domains, backhaul, far asset catch, tunnel hub and client, forward row, door, rejected hop, linked, demo, HA front forward, HA ingress, regional name.
- Census: Edge.ServeHTTP and Edge.serveDemoTraffic (body, read sites unchanged), envelope internal/edge; card docs/superpowers/notes/census-proposal-static-site-geo-962.md. Astra approved all three in rounds 1 and 2.
- Astra: R1 NOT READY (demo P1, test P2), fixed; R2 READY AFTER FIXES (test P2), fixed. Review stopped at round 2.
Commits
9
Discussions
0
0 open
Tasks
0/0
done
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- paul@keymail.dev pushed 5e7326f47 census: refresh the static-site-geo-962 card after merging main
- paul@keymail.dev pushed 6cf955295 Merge origin/main into static-site-geo-962
- paul@keymail.dev pushed 9b497320b Merge origin/main into static-site-geo-962
- paul@keymail.dev pushed 4e1465803 census: re-pin Edge.serveDemoTraffic in the record-write census (#962)
- paul@keymail.dev pushed 9d210aa61 edge: geo answer tests through HA forward, HA ingress, regional (R2)
- paul@keymail.dev pushed f5bceb83f review: Astra brief for static-site-geo-962, round 2
- paul@keymail.dev pushed 07a813d8e edge: answer /.carlos/geo on demos too; tests for every geo arm (R1)
- paul@keymail.dev pushed 565cbe67f review: Astra brief for static-site-geo-962, round 1
- paul@keymail.dev pushed 2edc14b3d edge: answer /.carlos/geo with the visitor's country, for static sites