Since I am in Japan, I set Caddy v2 for VPS in Tokyo. VPS spec is $ 5 (minimum). result:
Seconds
Services
0.02
http://whatismyip.akamai.com/
0.03
(My Service http)
0.03
http://inet-ip.info/ip
0.04
(Japanese rental server http)
0.04
http://icanhazip.com/
0.05
(My Service https)
0.06
https://icanhazip.com/
0.09
https://canhazip.com/
0.20
(Japanese rental server https)
0.21
http://ifconfig.me/ip
0.24
https://bot.whatismyipaddress.com/
0.27
http://wgetip.com/
0.28
https://ifconfig.me/ip
0.29
https://ipecho.net/plain
0.29
https://ipinfo.io/ip
0.29
https://wgetip.com/
0.36
http://checkip.amazonaws.com/
0.47
http://alma.ch/myip.cgi
0.47
http://l2.io/ip
0.52
http://ident.me/
0.53
https://ifconfig.co/ip
0.55
http://eth0.me/
0.56
https://bot.whatismyipaddress.com/
0.57
http://ip.tyk.nu/
0.76
https://checkip.amazonaws.com/
0.77
https://api.ipify.org/
0.80
https://ipv4.wtfismyip.com/text
0.80
https://wtfismyip.com/text
0.85
http://tnx.nl/ip
0.97
https://alma.ch/myip.cgi
0.99
https://l2.io/ip
1.09
https://ident.me/
1.19
https://eth0.me/
1.20
https://ip.tyk.nu/
1.65
https://tnx.nl/ip
Seconds: The average measured several times, except for the first time referring to the name server
Japanese rental server: Web server adopts Apache, the following PHP was used:
And there is no need for files, if all you want is a plaintext IP address in the response.
(FYI, later I might be removing template actions like {{.RemoteIP}} in favor of a single action that just accesses existing placeholders, like {{placeholder "http.request.remote.host"}} or something. So just be aware of that, before we leave beta.)
Ah, it’s because header sets "deferred": true in the underlying JSON, so the header isn’t added until after the response starts being written (after templates does its thing).
I will change it so that it is not deferred when adding or setting, but is deferred for deleting headers… that should fix it up. But yeah, that Caddyfile is right, pending this change.