PHP Classes
elePHPant
Icontem

HTML Compactor: Reduce HTML document size by removing white-spaces

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2008-04-30 (8 years ago) RSS 2.0 feedStarStarStarStar 60%Total: 1,694 All time: 2,245 This week: 1,090Up
Version License PHP version Categories
compactor 0.6.0BSD License5HTML, PHP 5, Compression
Description Author

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.

It can also send deflated/gzipped content.

Innovation Award
PHP Programming Innovation award nominee
January 2008
Number 6


Prize: One subscription to the PDF edition of the magazine by PHP Architect
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.

Manuel Lemos
Picture of Oliver Lillie
  Performance   Level  
Name: Oliver Lillie <contact>
Classes: 4 packages by
Country: Finland Finland
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file compactor.example1.php Example Example File 1
Accessible without login Plain text file compactor.example2.php Example Example File 2
Accessible without login Plain text file compactor.php Class Class Source

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,694
This week:0
All time:2,245
This week:1,090Up
User Ratings User Comments (4)
 All time
Utility:87%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:81%StarStarStarStarStar
Tests:-
Videos:-
Overall:60%StarStarStarStar
Rank:1111