shoepolish
shoepolish is a Ruby program, that uses a toolset of OSS utilities to optimize file content for space and bandwidth reduction. You could use this on either a private file collection to save drive space, or on a live website to reduce bandwidth costs.
How it works
The selected directory is recursively scanned for subdirectories. Then each subdirectory is analyzed for common web and image files. Those files are then modified by the appropriate tool. This is all done in a multi-threaded fashion, so no one file will hold up another's turn, but the screen can look confusing while the script is running.
Caveats
The utilities included are used to also obfuscate code, and poorly-written or ASP.NET code could require hand-adjustment after an aggressive scan is done. You should backup your files before running this tool, and any CSS or Javascript file should be duplicated in an off folder for your own editing purposes.
Requirements
- Ruby: for the program itself.
- Java: for the YUICompressor utility.
Current toolset
- CSSTidy: used for CSS optimization
- HTML Tidy: used to convert HTML to XHTML
- jpegtran: lossless JPEG reduction
- OptiPNG: lossless PNG reduction; GIF->PNG conversion
- YUI Compressor: Javascript optimization; uses the Java/Mozilla-based Rhino library.
- advzip: recompresses ZIP files with 7-Zip's DEFLATE method.
Modes
- Basic: optimize CSS; recompress JPEG; recompress PNGs; recompress ZIP files
- Aggressive: Basic + HTML optimization + JavaScript optimization + GIF->PNG site conversion
Download / Project Access
Project development and downloads of shoepolish are available on SourceForge.
https://sourceforge.net/project/showfiles.php?group_id=212594
Command lines
- Basic scan: shoepolish.rb directory-path
- Aggressive scan: shoepolish.rb directory-path aggro
- GZIP scan (precompress HTML files): shoepolish.rb directory-path gzip
- GZIP reverse (decompress files): shoepolish.rb directory-path ungzip
Further reading