While working on RadiantCMS based site, i start searching for tool, which will let me optimize html output, rendered by CMS.
Sean Cribbs give me good advice on IRC — Rack Middleware — Rack::Tidy.
You can follow installation steps from coderack entry page.
TIDY_LIB = '/usr/lib/libtidy-0.99.so.0'
require 'rack/tidy'
I used only two non-default option:
config.middleware.use Rack::Tidy,
:ignore_paths => ['/admin'],
:indent => false
I get problem with running this setup on my ubuntu vps, i get segmentation fault from tidybuffer.
Found simple patch on rubyforge.
Let me know if so.