Abstract: A method and apparatus for compressing a continuous, indistinct data stream is disclosed. According to one aspect of the present invention, the data stream is examined to determine whether it is compressible. If compressible, the data stream is then attached to a compression stream, and compression is performed immediately to generate a compressed data stream. The compressed data stream is transmitted continuously as it is generated. According to another aspect of the invention, the data stream is an HTML data stream.