To compress output generated by rails you need to define a
before_filter. As stated the Rails book has a full example of this,
and I think Sir Google has it too.
What isn''t in the book (afaik) and what can bite you is combining
compression with page caching. If you use page caching, rails will
store the entire page under the public directory for lighttpd to
serve. This will cause problems if a compressed version of the page
is cached and then served to a user whose browser doesn''t support
compression.
What I do in this case is disable compression in rails and let
lighttpd compress the output using mod_compress. The side benefit of
this is lighty caches the compressed file for even greater
performance gains, and of course only serves it to those clients that
support compression.
hth
--Dave.
On 18-Jul-05, at 6:38 AM, Dee Zsombor wrote:
> There was a "Compressing Rails Output" theread about this a few
days
> ago. Also the reails book has a section about this. In short it is
> possible.
>
> On 7/18/05, Jamie Wilson
<jamie-2Syp1OKOp8xcvV0ECPNCqg@public.gmane.org> wrote:
>
>> Hi,
>>
>> The docs for mod_compress in lighttpd say that it currently only
>> supports compressing static content:
>>
>> http://www.lighttpd.net/documentation/compress.html
>>
>> I seem to recall coming across something that said how to compress
>> the HTML generated by Rails. Any clues for the clueless?
>>
>> Thanks,
>> ...j
>> _______________________________________________
>> Rails mailing list
>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
>
>
> --
> http://deezsombor.blogspot.com
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>