mod_ruby + mod_deflate

Discussion in 'Ruby' started by Salvatore Sanfilippo, Aug 1, 2007.

  1. Hello!

    I'm running an application written in Ruby using mod_ruby wtih Apache,
    the application is pretty fast and responsive but output compression
    via mod_deflate may help to bring even more speed and save bandwidth.

    The problem is that it appears to be very hard to make mod_ruby and
    mod_deflate to play well together.

    This is my simple mod_deflate configuration:

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    </IfModule>

    Indeed I'm generating text/html from mod_ruby.

    Still it does not compress at all, while in the same box
    output from PHP scripts are compressed without problems.

    I tried to load the deflate module as last module but still
    it does not work.

    Somebody aware of the black magic required to make this working?

    Thank you very much for your help,
    Salvatore
     
    Salvatore Sanfilippo, Aug 1, 2007
    #1
    1. Advertising

  2. Salvatore Sanfilippo

    Vincent Bray Guest

    On 01/08/07, Salvatore Sanfilippo <> wrote:
    > <IfModule mod_deflate.c>
    > AddOutputFilterByType DEFLATE text/html text/plain text/xml
    > </IfModule>
    >
    > Indeed I'm generating text/html from mod_ruby.


    That's fine, but apache may not know that. First, get rid of the
    IfModule lines, they just serve to make debugging problems like this
    harder (because it could be that you don't have the module loaded).
    And then, check how you're telling apache to pass the request on to
    mod_ruby. If it's with AddType, replace that with AddHandler, and use
    AddType to tell apache that the mime-type of your handler is
    text/html. If that doesn't help, reply (to me directly too please, I
    find this list hard to keep up with) with your apache config and I'll
    see if I can reproduce the issue.

    --
    noodl
     
    Vincent Bray, Aug 1, 2007
    #2
    1. Advertising

  3. On Aug 1, 6:43 pm, "Vincent Bray" <> wrote:

    > > Indeed I'm generating text/html frommod_ruby.

    >
    > That's fine, but apache may not know that. First, get rid of the


    Ok Thanks, actually adding the line:

    AddType text/html .rhtml

    to my existing configuration solved the issue, now the
    pages are compressed correctly.

    The only *virtual* problem with this is that if I want
    to generate images or other content it's not worth
    to compress from Ruby this may be compressed anyway
    but I solved the issue using .rb files to generate
    this kind of content while using .rhtml files only when
    the output is really HTML, so everything is fine.

    Thanks again,
    Cheers,
    Salvatore
     
    Salvatore Sanfilippo, Aug 3, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Youngblood

    mod_ruby under windows

    Carl Youngblood, Jul 22, 2003, in forum: Ruby
    Replies:
    4
    Views:
    164
    Gawnsoft
    Jul 23, 2003
  2. Carl Youngblood

    Web tools for mod_ruby - Dave Thomas

    Carl Youngblood, Jul 25, 2003, in forum: Ruby
    Replies:
    0
    Views:
    83
    Carl Youngblood
    Jul 25, 2003
  3. David Corbin

    WeBrick,mod_ruby

    David Corbin, Aug 17, 2003, in forum: Ruby
    Replies:
    0
    Views:
    103
    David Corbin
    Aug 17, 2003
  4. Robert McKinnon
    Replies:
    1
    Views:
    193
    Dave Thomas
    Mar 6, 2004
  5. Leif Wessman
    Replies:
    1
    Views:
    122
Loading...

Share This Page