Summary

To summarize what has been discussed so far, I would like to highlight some of the important aspects of the client-to-server communication. Communications based on a system of special rules and formats for messages to enable data exchange between clients and servers is known as a communication protocol. Any device connected to the Internet has a unique IP address. A message transmitted from one device to other over the Internet follows a long route to be delivered via the protocol stack. HTTP is a text-based application protocol that makes the Web work. Web browsers or standalone applications send a request and open a connection to the web server. The web server complies with the request and closes the connection to the web client.

AJAX is a technology that allows client-side JavaScript code to request data from a server without reloading the current page in the web browser. HttpRequest (formerly XMLHttpRequest) has an important role in the AJAX web development technique. The AJAX polling request periodically issues a request to gain new information. A long polling request always keeps an open connection to the server. This connection is still alive until the server decides to submit the information back to the client where there are changes and then closes the connection. The client will again open a connection to the server to start a new long polling request.

In SSE, a client opens a connection to the server via an initial HTTP request, and the server sends events to the client when there is new information available. The response sent back via SSE is plain text served with a text/event-stream content type. It contains one or more lines of string that begins with a data: string and ends with a newline character. Finally, the whole message ends with an extra newline character.

WebSocket is a bidirectional, message-oriented streaming transport between a client and server. It is built on TCP that uses an HTTP upgrade handshake. The API enables the layer and delivers arbitrary application protocols between a client and server in a streaming fashion and is initiated on either side at any time.

In the next chapter, we will discuss the ability to store data locally on a client and break the storage limit of cookies in our web applications. We will also demonstrate how to use Web Storage and explore a more powerful and useful IndexedDB to store a large amount of data in the user's web browser.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.196.172