Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there,

Areas of note: Windows development, ASP.Net web application, WebAPI, Visual Studio 2019, .Net 4.7.2

I have come to a project late in it's current lifecycle and am helping look at a problem with asynchronous javascript callbacks to a WebAPI. We develop the website, but people upload javascript based content to the website that can then 'run' essentially inside our website. This is created using Adobe Captivate. They are learning modules to teach people how to do things. Screen shot, click next, question, click next, you get the idea ... (?).

There needs to be communication back to our web server to indicate the progress of the course being taken and how well they have done. We have no control over these calls and they can happen one at a time or dozens at a time. Either way we need to do the calls back to the server asynchronously so as not to slow down the web page.

We have control over the javascript performing the call back to the API, but not really when those calls are required to be made.

Our problem is that these calls:
1. Can come in a glut of dozens, and then IIS seems to bank them up and especially in IE they can take up to 30 or 40 seconds for 1 call to complete
2. Based on 1. above, it appears that the call is not asynchronous as the page waits for the completion of the call before proceeding.

Any help in this area would be greatly appreciated as we are running out of ideas.

Ask if you want to see the js, not sure if it's being blocked here.

The WebAPI is a standard new .Net WebAPI created in VS 2019.

I should add that we have tried removing any code that executes in the WebAPI .Net code, so that it is essentially doing nothing, but the same delays occur.

Julian

What I have tried:

Replacing WCF web servicxe with modern WebAPI
Different browsers, IE11 being worst for delays
changing the jQuery call with straight javascript
I should add that we have tried removing any code that executes in the WebAPI .Net code, so that it is essentially doing nothing, but the same delays occur.
Posted
Updated 4-Dec-19 6:59am
v2
Comments
Richard Deeming 4-Dec-19 13:07pm    
The most likely cause is having session state enabled on the service. With the default settings, you can only execute a single request at a time for a given session. If possible, try changing it to read-only, or disabling session state entirely for your service calls.
Jugs 0101 4-Dec-19 16:37pm    
Richard. That is a fantastic suggestion. Initial tests indicate that this is going to be a massive improvement. If we get it live and it works, I'll get back in contact and seriously send you a bottle of wine in the post, unless beer is your thing....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900