Investigate why https requests from outside are also more than ten times slower than requests from inside Toolforge. As it takes more than 0.5s, even for small static files, something is most likely not working as it should be.
Timing from Flask web-service
Request time for imagehash search when done from Toolforge locally, it is fast. 0.05s. Content of the response is just JSON with body`[]`. The transferred data is almost none.
from Toolforge
zache-tool@tools-sgebastion-10:~$ time curl -o - "https://imagehash.toolforge.org/search?dhash=8173317847711556465&phash=17187026160256130104" [] real 0m0.050s user 0m0.022s sys 0m0.005s
; However, if i try same request from remote locations speed difference is 1:10, ie. it takes more than 0.5s.
from local OS X laptop (Helsinki, Finland)
time curl -o - "https://imagehash.toolforge.org/search?dhash=8173317847711556465&phash=17187026160256130104" [] 0.01s user 0.01s system 4% cpu 0.498 total
from ajapaik.ee Linux server (Estonia)
zache@ajapaik:~$ time curl -o - "https://imagehash.toolforge.org/search?dhash=8173317847711556465&phash=17187026160256130104" [] real 0m0.513s user 0m0.027s sys 0m0.004s
Timing from PHP web-service/static files
from Toolforge
zache-tool@tools-sgebastion-10:~$ time curl -o - "https://fiwiki-tools.toolforge.org/helloworld.txt" Hello World real 0m0.035s user 0m0.015s sys 0m0.005s
from local OS X laptop (Helsinki, Finland)
time curl -o - "https://fiwiki-tools.toolforge.org/helloworld.txt" Hello World curl -o - "https://fiwiki-tools.toolforge.org/helloworld.txt" 0.02s user 0.01s system 5% cpu 0.485 total
from ajapaik.ee Linux server (Estonia)
time curl -o - "https://fiwiki-tools.toolforge.org/helloworld.txt" Hello World real 0m0.654s user 0m0.022s sys 0m0.013s