2

i have a quite strange request: i want to "compress" all the output from a rails app; with this i do not mean gzip or any similar compression, i mean to reformat the whole output (preferably with apache/passenger but can also be a rack middleware or rails plugin)

anyone knows if something like this exists? any apache module out there? if not, what would be a good way to implement something like this?

just to be more clear what i want:

<html>
    <head>
        <title>page title</title>
    </head>
    <body>
    info!
    <!-- my comment -->
    </body>
</html>

should become

<html><head><title>page title</title></head><body>info!<!-- my comment --></body></html>

ideally, also comments and other shenanigans are removed, so ideally it would look like this

<html><head><title>page title</title></head><body>info!</body></html>

again, just to avoid having mod_deflate or gzip discussions again: i know that such things as gzip compressors exists. i am specifically searching for a way to text-filter with apache or rails (rack).

thanks for any pointers!

z3cko
  • 3,054
  • 8
  • 40
  • 59

1 Answers1

0

This may not be feasible, but how about a deployment task that "cleans" all your templates?

TK-421
  • 10,598
  • 3
  • 38
  • 34
  • thanks for the fast answer. unfortunately, this is not what i am searching for. i would prefer to keep my code readable, but the output compressed. but thanks for the pointer. – z3cko Jan 27 '11 at 22:40