Since most CDNs are already doing GeoIP lookups (for request headers or log entries), you can leverage that to provide the data back in the response body via origin, worker or even CDN edge config. Programmatically populating the response body, as in the Cloudflare worker example from the post, is better than going to the origin just to echo some headers back in the response. To me, something like Fastly's VCL config…
"client": {
"conn_speed": "broadband",
"conn_type": "wifi",
"proxy_description": "vpn",
"proxy_type": "hosting"
Is this what Fastly is thinking about my IP?