Orange is my favorite color

I’ve been trying on and off to get Apache 2.0.x to compress HTML and XML output from ColdFusion. I’ve got CSS and Javascript compressing just fine and can verify it through the mod_deflate custom log format, but anything that comes out from ColdFusion via mod_jrun20 is returned uncompressed.

According to the Apache docs, the DEFLATE filter is put in the chain after any RESOURCE filter (the example given was for PHP, but I assume mod_php and mod_jrun20 are implemented similarly).

Does anyone have this working?

6 Comments

  1. Dan G. Switzer, II said:

    on November 9, 2007 at 8:35 am

    I wonder if you have to do it by mimetype. Also, you probably need to load mod_deflate before anything else that can affect the output stream (SSL, CF, PHP, etc.)

    I don’t have a lot of experience with Apache though, so I could be way off base. :)

  2. brian said:

    on November 9, 2007 at 8:56 am

    Dan, interesting idea. I do have mod_deflate loaded before mod_jrun although I don’t know if that matters. And the config is by mime-type, looks like this:



    AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/xml application/x-javascript

    Note that CSS and Javascript are working. And last time I tested, static .html files are OK too but anything that comes out of ColdFusion (.cfm files that return text/html or text/xml for example) is uncompressed.

    I’ve verified via the mod_deflate logging that it is returning text/html or text/xml. I guess it’s time to file a bug with Apache and see what people think?

  3. Dan G. Switzer, II said:

    on November 9, 2007 at 9:16 am

    @Brian:

    Something I read said the mod_deflate has to be loaded before the very first module that could take over the output stream. So if though it’s loaded before mod_jrun20, it could be loaded after another module. From the blurb I read, it sounds like maybe there’s some kind of chaining that goes on in the request output stream, so if mod_deflate isn’t loaded before the very first modules that affects that chain, then it might not work.

    It’s kind of surprising that there’s not much information on Google (at least that I found quickly.) This thread from CF-Talk seems to imply you might have to run through mod_proxy:

    http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32340/sort:2

  4. Simon Handfield said:

    on November 9, 2007 at 2:48 pm

    Try the examples at http://www.devside.net/guides/config/compression

    It provides different methods to deflate: deflate only certain files or deflate all files except certain types.

    I use the latter method successfully to deflate all my CFML and XML.

    :)
    s

  5. Orange is my favorite color » Blog Archive » Make mod_deflate work reliably with mod_jrun and ColdFusion MX said:

    on November 9, 2007 at 4:33 pm

    [...] earlier post yesterday asked if anyone had it working and the real answer is “no”. Some people have [...]

  6. brian said:

    on November 9, 2007 at 4:34 pm

    Got a fix! There is a : bug in mod_jrun.

{ RSS feed for comments on this post}