Examples for Negotiations between browser (client) and a server via HTTP
Content Negotiation: This negotiation occurs when the client and server need to agree on the format or language of the content being exchanged. For instance, imagine a scenario where a client requests a web page from a server. The client's browser sends an HTTP request stating that it prefers to receive the content in English. If the server supports multiple languages, it can examine the client's request and respond with the web page content in English or any other available language that matches the client's preferences.
Compression Negotiation: Compression negotiation takes place when the client and server negotiate whether to compress the data being transferred. Compression reduces the size of the data, resulting in faster transmission times. The negotiation involves the client indicating its ability to handle compressed data, and the server responding with a compressed or uncompressed version of the requested resource based on the client's capabilities.
Cache Negotiation: Cache negotiation occurs when the client and server negotiate whether to use cached (previously stored) versions of a resource. If a client has previously downloaded a resource and has it stored in its cache, it can send a request to the server with an indication that it wants to use the cached version if it's still valid. The server can respond with a "304 Not Modified" status if the cached version is up to date, saving bandwidth and reducing latency.
Protocol Negotiation: Protocol negotiation involves the negotiation of the specific version of HTTP to be used during communication. For example, a client can send an HTTP request specifying that it supports HTTP/2.0, and the server can respond with the chosen version of the protocol, such as HTTP/1.1 or HTTP/2.0, based on its capabilities and configuration.