Extensive Ajax requests are hindering brief Ajax status updates

I am currently running an ASP.NET MVC application on IIS with two main handlers, /DoWork (which takes about 10 minutes to complete) and /ReportStatus (which takes less than a second). The purpose of DoWork is to perform a task while ReportStatus provides updates on its progress.

My plan was to use asynchronous $.ajax requests in JavaScript to run /DoWork and monitor its progress by constantly querying /ReportStatus. However, I have encountered an issue where the long running $.ajax request on /DoWork seems to block all other queries on /ReportStatus until DoWork is completed.

How can I resolve this? Could this be related to server settings on IIS that limit active requests from one host? Any suggestions?

One solution I thought of is to have /DoWork execute the task in a background asynchronous thread and return immediately. But I am curious if there are better alternatives, especially since I want to maintain an open connection during the execution of /DoWork.

Answer №1

After taking colecmc's advice, I decided to use WebSockets for my project. Instead of depending on Windows 8+ or Windows 2012+, I opted for a lightweight implementation known as Fleck which can be found on Nuget.

Check out this link for more information:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guidelines for importing Json information onto a Charts.js visualization

I am looking to integrate the "temp" data variable, identified by ID within (.list), from the provided Json () as an x-axis variable in the chart below: var ctx = document.getElementById('myChart').getContext('2d'); var chart = new Char ...

Enhancing elements with fade-in effects upon hovering

Is there a way to incorporate a subtle fade in/fade out effect when hovering over items on this webpage: http://jsfiddle.net/7vKFN/ I'm curious about the best approach to achieve this using jQuery. var $container = $("#color-container"), ...

Having trouble accessing the properties of an undefined variable (reading 'VSCODE_TEXTMATE_DEBUG')

Encountering an error while attempting to use Shiki in Nuxt3. The cause is unknown, even after trying to add the environment variable with no success. Here's a recreation of the error: https://stackblitz.com/edit/github-whzftm?file=pages%2F%5B...slug ...

Utilize jQuery and AJAX to fetch a JSON file by passing parameters

Can anyone guide me on how to call a JSON file with parameters? In the past, I've used PHP and converted it to JSON. Below is the jQuery code snippet: $("#btnKeyword").on("click",function(){ var param = document.getElementById('inputKeyword& ...

Modifying the timing in a .SRT file by adjusting seconds

I have scoured the web and found no similar solution. My goal is to develop a simple PHP/js/jq script that can adjust the timing of an .srt file by adding or subtracting seconds. I am unsure whether using regex would be the best approach for this task or ...

Using a uibCollapse within a nested directive element may not function as expected

Whenever I try to click on my custom directive, the elements that are supposed to expand remain collapsed. To ensure that the click event is actually triggered, I have specified a size in the css for the .btn class. // index.html <body ng-controller=" ...

The hierarchical structure in the DOM that mirrors an HTML table

While working on code to navigate the DOM for a table, I encountered an unexpected surprise. The DOM (specifically in FF) did not align with my initial expectations. Upon investigation, it appears that FF has automatically inserted a tbody along with sever ...

What could be the reason for react-query searching for dispatch even when redux is not activated or present in the component?

I am currently working on a component that is supposed to fetch logged-in users from the server. Despite Swagger indicating that the server code returns correctly, the component fails to make the necessary fetch request when loaded. Below is the code snip ...

Manage the lineup of tasks in the bull queue by organizing them into groups

I am currently working on a nodejs application that handles queues using the bull library. The application is required to make multiple asynchronous HTTP requests and then process the results of these calls. I'm curious about whether bull would be an ...

Having trouble sending data to a Django function with Ajax request

I am currently facing an issue with my AJAX calls in Django. While fetching data works seamlessly, adding new data is resulting in an error message. Method Not Allowed (POST): /mymodels/ Method Not Allowed: /mymodels/ [17/Mar/2020 22:27:24] "POST /mymodel ...

The jquery accordion title width does not align with the content width when an icon is included

Is there a way to adjust the widths of the heading and div elements after adding edit and delete icons to match the standard accordion style? Thanks <div id="accordion"> <h3><a href="javascript:;"> ...

Developing a placeholder directive with AngularJS

Are you looking to create a unique element in AngularJS to facilitate nested ng-repeats? Take a look at the example below: data.test = [{h:1, d:[11,12]}, {h:2, d:[21,22]}]; ---------------------- <custom ng-repeat="a in data.test"> <h3>{{a ...

Hey there, I have a header.css file!

My React project is experiencing issues with the CSS file. The first header in the CSS file works fine, but the second header and every other class created after it are not responsive. Only the 'header' class is properly linked to Header.css file ...

Are there any comparable features in JavaScript and TypeScript that mirror Julia's metaprogramming and macros?

Having experience with Julia macros for metaprogramming, I find them to be a convenient way of generating versatile code. I'm curious if there is an equivalent approach in JavaScript or TypeScript. Is there a package or method that offers similar fun ...

Issue with URL parameter in React when using React Router

Initially, everything was running smoothly in my React project using react-router-dom. However, once I added another Route like so: <Route path="/edit/:id" component={EditPage}/> and tried changing the URL in the browser to http://localhos ...

What is the process for decoding HTML content that is wrapped within JSON data?

I have a web application built using asp.net that utilizes ajax calls. Below is the code snippet for my web method which successfully responds to the ajax call. ADController adc = new ADController(); DataTable dt = adc.GetGeneral(Convert.ToInt32(A ...

Utilize Express efficiently by requiring modules only once for multiple routes within the application

Here is an overview of my project directory structure: MyProject -app.js -routes -routeone -routetwo In the app.js file, I have the following setup: var express = require('express'); var app = express(); var routeone = ...

Display the div only after all images have finished loading in response to the AJAX call

Prior to diving into this, I am determined to steer clear of utilizing Jquery for personal reasons that I won't delve into. So please refrain from suggesting it, as that is not the solution I seek. I am currently working on a web page that sends mult ...

Replace the plus signs in a string with spaces using the JSON.stringify method

When utilizing AJAX, I am sending the string someString to a PHP handler. xmlHttp.open("POST", url, true); var someString = 'Foo+Bar'; var params = 'operation='+operation+'&json='+JSON.stringify(someString); xmlHttp.send( ...

Every time I execute my code, my website undergoes a refreshing process

$(document).ready(function() { $("#btn").click(function() { $("#form").toggle(); }); $("#submit").click(function() { if ($(".product").checked = true) { alert("Thank You!") } else { alert('Please Choose A Product'); ...