I am writing a JavaScript application on the Electron platform. Electron contains the Chrome engine. The task is to obtain currency quotes from a specific service. For this, the same request is sent in a loop. The response received after the first request contains an ETag header. The engine automatically processes the response and in the next my request includes an If-Non-Match header. And if the data has not changed, a response with the code 304 is received, it breaks (or closes) the previously established connection. On the quote server there is a limit of 2 connections per second. Since quotes can change several times per second, sending a request once a second is not an option. Is it possible to disable automatic processing of the ETag header? namely, not to include the header if-non-match inclusion in subsequent requests?

  • Uh ... why does this suddenly answer 304 close the connection? .. - Pavel Mayorov
  • Yes, I don’t know, but after receiving the response, the connection is re-opened, so I assumed, although Connection Keep-Alive is in the response and in the request - user185252
  • @ user185252, and you do not confuse? Restriction in two connections or all the same in two requests per second? - Dmitriy Simushev
  • exactly two connections. requests allow up to 60 per second. - user185252

0