开发者

html text output compression from rails (or apache/passenger)

开发者 https://www.devze.com 2023-02-06 22:57 出处:网络
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 ap

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></hea开发者_运维知识库d><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!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消