1

Every time my page loads, it sends 3 different requests to a WCF REST API hosted on an IIS server.

2 of the request are GET (short ones) and one is POST which takes about 5-10 secs.

After the page loads the user can filter and sort elements on the page.

The weird thing is that once the post is running, if the user tries to filter or sort, the get request triggered by it is delayed until the POST request is done.

Any ideas?

UPDATE:

This is the post request code:

$.ajax({
        url: fullURI,
        cache: false,
        type: 'POST',
        data: dataJson,
        dataType: "json",
        contentType: contentTypeParam,
        processData: true,
        beforeSend: function (xhr) {
            xhr.setRequestHeader('Authorization', Authorization);
            xhr.setRequestHeader('Accept', contentTypeParam);
        },

        success: function (data, textStatus, jqXHR) {
            callbackMethod(data, params);
        },

        error: function (jqXHR, textStatus, errorThrown) {
            restCallFailed(jqXHR, textStatus, errorThrown, isBusy, params, fullURI);
        }
    });

Blocking the page until this data is loaded is not an option, so the user is able to interact with the page before the request is done.

UPDATE:

I found THIS post, so i started looking for the equivalent in .NET and found SessionMode. I tried setting it to NotAllowed but to no avail :(. Anyone knows what is the .Net alternative to session_write_close?

Community
  • 1
  • 1
Tomer
  • 17,787
  • 15
  • 78
  • 137
  • Any code to show? Should the controls be usable before the POST is complete? Can you disable them until it is, even if _also_ working on getting the process going asynchronously? – Grant Thomas Oct 24 '12 at 09:43
  • though `async` is `true` by default, but you think you can just check by setting it to `async: true`. btw, please put the codes that generates `get` type requests too. – HungryCoder Oct 24 '12 at 09:51
  • Do you calling `$.ajaxSetup` function anywhere? – Yuriy Rozhovetskiy Oct 24 '12 at 09:53
  • @HungryCoder - tried it and didn't help :(. The get request looks exactly the same, only difference is `type: 'GET'` – Tomer Oct 24 '12 at 10:40
  • Why don't you try to look at `Net` tab in `FireBug` to have visual representation of your execution timeline? – Reflective Oct 24 '12 at 12:00
  • @Reflective - I actually already did it and it didn't tell me nothing new, the post is taking about 15 secs and is blocking other ajax requests until it is done. – Tomer Oct 24 '12 at 12:01
  • There is some major changes about AJAX in 1.8 .. you can give it a try – Reflective Oct 24 '12 at 13:02
  • @Reflective - unfortunately i can't, since i'm working in a big company and changing a version is not as easy as just downloading it :( – Tomer Oct 24 '12 at 13:04
  • Maybe the TimeLine in 'Net panel' in Firebug can tell you more. Maybe the GET's are blocked by IIS. – Niels Steenbeek Oct 24 '12 at 14:13

0 Answers0