Sites that serve many pages have significant costs, not only in terms of bandwidth usage, but also in terms machines needed to serve many simultaneous user requests.
One way to reduce such costs is to minimize the size of the pages served to the users. This class may be used to achieve that purpose.
It uses PHP output buffering support to capture the HTML pages generated by PHP scripts and automatically reduces the size of the pages before serving to the users.
This class can be used to reduce the size of HTML documents by removing unnecessary comments and white-spaces.
It can process an HTML document passed explicitly as a string. It may also capture all the output of a PHP script and compact it before serving to the user browser.
The class can reduce the size of the document by applying several operations like unifying the document line breaks, removing white-space from script and CSS style definitions, stripping comments, and unnecessary tabs, spaces and line breaks.