There are gzip compression options available but when I looked at this a long time ago I found that the extra server load to compress (with out caching) and the extra delay in the browser to decompress was not worth the few bytes it saved and lead to longer times before seeing the fully rendered page.
After a little digging and trying a few gems which failed to set there dependancies correctly and even
required 'pp'*, I found TidyFFI.
- Really useful for debugging but I do not think has a place in deployed code.
gem install TidyFFI
get '/' do erb :'about' end
require 'tidy_ffi' get '/' do TidyFFI::Tidy.new( erb :'about' ).clean end