Proxy lookup takes a lot of time in TideSDK

264 Views Asked by At

I'm trying to make ajax call to a server through localhost. When I try to make the ajax call via my browser it takes approximately 1 second. But when I try to make the call via the application, it says:

Looking up proxy information for: http://localhost/myapiaddress

and locks the application for 5 seconds then makes the call and then I can get the response after 1 or 2 seconds. I guess the API simulates the ajax call for the proxy information before the real call but it takes a lot time. After the first ajax call, all the other calls takes only 1 second.

Here is my ajax call:

$.ajax({
    type: "GET",
    url: apiurl,
    data: {t: someparameter},
    success: this.success,
    error: this.error,
    timeout: this.timeout,
    async: true
});

What can I do to decrease the lookup time on the first ajax call? Any help would be appreciated.

1

There are 1 best solutions below

1
On

A good trick which may work around your problem would be to make ajax request using TideSDK as soon as the page loads, it sounds like it is caching the proxy information that it finds so sending a request would force it to cache so the users future requests wouldn't be limited by the proxy lookup.