July 25th, 2012 by Lincoln Baxter III

Rewrite 1.1.0.Final introduces the OutputBuffer – What Servlet always wanted but could never have

Output buffering is a feature often desired but rarely properly implemented – Properly resetting the Response stream, preserving headers correctly, writing to disk so you don’t overflow the JVM memory space – in Rewrite, we hope to make this attainable for anyone seeking to do things like:
  • Dynamic minification of HTML, JavaScript, and/or CSS files
  • Modification of output HTML or content before it is sent to the client.
  • Reduction of build and development complexity by transforming LESS or SASS files into CSS on the Server
  • Got more ideas?… tell us.?
Now, using the Rewrite’s “OutputBuffer” API introduced in the new version 1.1.0.Final, you can finally achieve this in just a few lines of code, either by wrapping a stream, or simply modifying the contents directly!