The HTTP protocol itself is readable as text. This is useful because you can telnet into any server at all and communicate with it.
Being text also allows you to easily watch HTTP communication with a program like wireshark. You can then diagnose the source of problems easily.
HTTP defines a way to work with resources
. These resources do not need to be text, they can be images, or anything else. A text resource can be sent as binary by specifying the Content-Encoding
header. Your resource type is specified via the Content-Type
header.
So your question really only applies to the HTTP protocol itself, and not the payload which is the resources.
The web would be way faster and browsers would be able to load binary pages very fast.
I don't think this is true. The slowest part is probably connection establishment and slow TCP start.
Here is an example of how an HTTP response would send a text resource with a binary representation:
HTTP/1.1 200 OK
Server: Apache/2.0
Content-Encoding: gzip
Content-Length: 1533
Content-Type: text/html; charset=ISO-8859-1