Closed codefrau closed 8 years ago
Wouldn't it be better if we check the URL if a proxy is needed in the first place?
There is no way to know in advance if a server is CORS-enabled or not, you can only try. We do not want to use the proxy unless it is necessary.
True, and keeping track of URLs as suggested here would certainly speed up requests. I'm happy to take care of this...
Currently we always try a direct request first, and the proxied one second. In some situations this leads to considerable delay (e.g. 2 seconds on source.squeak.org).
We might want to keep a table of hosts and their need-proxy flag. Whenever a request succeeds we put a flag for that host in the table. When another request comes in and we have a flag already then we use the order (proxy/direct first) given by the flag, otherwise we try direct first.