This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HTTP Header Connection "keep-alive"

Hi, I'm trying to do some tests of the AJAX feature of the embedded HTTP server (MDK 5.1.6 Network Component). The thing is, the server is always sending the HTTP header:

Server: Keil-EWEB/2.1
Content-Type: text/html
Cache-Control: no-cache
Connection: close

The problem is that, without

Connection: "keep-alive"

the TCP connection is being opened and closed for every refresh of an AJAX object, so the performance is not good when trying to refresh some page content, in spite of using AJAX.

Is there a way of overriding this in the HTTP Response header??

Regards.

Parents
  • AJAX doesn't require persistent connections. The persistence gives less network and CPU load for the web server, which often isn't important for an embedded device. A big web server with thousands of concurrent users on the other hand, might require that support to survive the hammering of all users. For AJAX, it's more important how the server can produce dynamic content instead of just emitting pre-generated files.

    And you can serve whatever Content-Type without really affecting the web server - unless you need on-the-fly compression of the data.

    And just so you know - I haven't checked what HTTP protocol version Keil's server claims to support - I have own HTTP server code that I use in both embedded devices and in PC programs. But feel free to look at the full response header, what HTTP version it claims.

Reply
  • AJAX doesn't require persistent connections. The persistence gives less network and CPU load for the web server, which often isn't important for an embedded device. A big web server with thousands of concurrent users on the other hand, might require that support to survive the hammering of all users. For AJAX, it's more important how the server can produce dynamic content instead of just emitting pre-generated files.

    And you can serve whatever Content-Type without really affecting the web server - unless you need on-the-fly compression of the data.

    And just so you know - I haven't checked what HTTP protocol version Keil's server claims to support - I have own HTTP server code that I use in both embedded devices and in PC programs. But feel free to look at the full response header, what HTTP version it claims.

Children
No data