When I use telnet to view my web, I get these weird numbers/letters in the output. This does not happen in a browser and they are definitely not in my source code. I have checked other sites and they do not have them. Any ideas why ? Are they garbage ? How can I get rid of them ?
telnet http://www.mysite.com 80
GET / HTTP/1.1
Host http://www.mysite.com
Some parts of the webpage are ok but others look like this (I have highlighted them in bold):
51
<ul>
<li><a href="/path/to/file
1b
">Link name</a></li>
<li><a href="/path-to-another-file
2a
EDIT: more info requested
Apache 2 and CGI (C)
Dynamically generated
The server is using “chunked” encoding, which allows the web server to keep HTTP connections open for reuse after a request for a dynamically generated page (e.g. CGI, PHP, or ASP), without buffering the entire page at the server end before transmission. It works by sending small parts (“chunks”) of the web page at a time that each have a specified length in bytes (the hexadecimal numbers you see scattered throughout the page). That allows the client to know when the server is done sending data.
Per RFC 2616 (the HTTP specification), all HTTP/1.1 clients are required to be able to decode chunked encoding. This means that if you do not want to receive a chunked response, you will need to request the page using the version identifier of HTTP/1.0, an older version of the specification:
The server will then close the connection after it has finished responding instead of using chunked encoding and keeping the connection open.