I have an Angular frontend, and a .NET CORE backend. I have one particular request which is quite heavy and takes a while to execute. When I look in the browser console, I get a 504: Timeout while reading response from the server.
The backend finishes the request, I can see in the logging it returns some JSON after a certain amount of time (somewhere after I get the time out).
First I tried adding a timeout header to the angular request as follows:
const options = { headers: new HttpHeaders({ timeout: `${10000}` }) };
This didn't work.
I also tried to add the function in my rxjs pipe.
this.service.getData(this.id, this.codeSystem, this.code)
.pipe(
timeout(120000),
map(data=> {
this.data = data;
}),
takeWhile(() => this.componentActive),
catchError(error => {
console.log(error);
}))
.subscribe();
After that I tried to increase the Connection Timeout under advanced settings in IIS, this also didn't work.
At this point I'm not sure where the problem is located or how to solve it. Does anyone have an idea/suggestion?