Tapestry 5
  1. Tapestry 5
  2. TAP5-469

ResponseCompressionAnalyzer: application/json responses should be uncompressable by default

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.0
    • Fix Version/s: 5.1.0.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      GZip compressed responses with Content-Type: application/json are not handled correctly by at least Firefox or IE and should be configured as uncompressable by default

      When the response is received in prototype's Ajax.Request response.responseText is "".

        Activity

        Hide
        Paudi Moriarty added a comment -

        I agree. I spent as much time as I could on it and had to move on. Let us know if you find out more.

        Show
        Paudi Moriarty added a comment - I agree. I spent as much time as I could on it and had to move on. Let us know if you find out more.
        Hide
        Howard M. Lewis Ship added a comment -

        I'd rather understand the problem better, but if this solves the symptoms, it will do for now.

        Show
        Howard M. Lewis Ship added a comment - I'd rather understand the problem better, but if this solves the symptoms, it will do for now.
        Hide
        Howard M. Lewis Ship added a comment -

        Ok, I'll set the default to no longer compress application/json. I have feelers out in the Prototype mailing lists and elsewhere to figure out what's going on.

        Show
        Howard M. Lewis Ship added a comment - Ok, I'll set the default to no longer compress application/json. I have feelers out in the Prototype mailing lists and elsewhere to figure out what's going on.
        Hide
        Peter Stavrinides added a comment -

        I get it as well, tested with Firefox 3, and IE7

        Show
        Peter Stavrinides added a comment - I get it as well, tested with Firefox 3, and IE7
        Hide
        Andy Blower added a comment -

        I have just encountered this issue in IE6, FF3 & Chrome2 on windows XP. The workaround fixes the issue as expected, but there definitely seems to be a problem here out of the box.

        Show
        Andy Blower added a comment - I have just encountered this issue in IE6, FF3 & Chrome2 on windows XP. The workaround fixes the issue as expected, but there definitely seems to be a problem here out of the box.
        Hide
        Howard M. Lewis Ship added a comment -

        I'm still not convinced this is necessary, but a workaround is:

        public static void contributeResponseCompressionAnalyzer(Configuration<String> configuration)

        { configuration.add("application/json"); }
        Show
        Howard M. Lewis Ship added a comment - I'm still not convinced this is necessary, but a workaround is: public static void contributeResponseCompressionAnalyzer(Configuration<String> configuration) { configuration.add("application/json"); }
        Hide
        Paudi Moriarty added a comment -

        I've noticed that the response is always chunked, only 10 bytes (with a correct gzip header) arriving in the first chunk when viewed in wireshark. The next chunk seems to have a zero length but wireshark reports a bad TCP checksum.

        Only gzipped application/json responses are chunked.

        I've replicated this with jetty-7.0.0.pre5 and using jetty-6.1.11 standalone (without maven). What configuration did you test?

        I'm now using a TextStreamResponse to bypass compression while setting Content-Type to application/json for Prototype as I don't really have time to delve too deeply into this.

        Show
        Paudi Moriarty added a comment - I've noticed that the response is always chunked, only 10 bytes (with a correct gzip header) arriving in the first chunk when viewed in wireshark. The next chunk seems to have a zero length but wireshark reports a bad TCP checksum. Only gzipped application/json responses are chunked. I've replicated this with jetty-7.0.0.pre5 and using jetty-6.1.11 standalone (without maven). What configuration did you test? I'm now using a TextStreamResponse to bypass compression while setting Content-Type to application/json for Prototype as I don't really have time to delve too deeply into this.
        Hide
        Paudi Moriarty added a comment -

        Interesting, this was observed in FF2 and FF3 on Linux and IE6 on Windows. I haven't seen it work with any browser which lends credence to your suggestion of server interference.

        I'm using the maven-jetty-plugin to run jetty-6.1.11 with no custom configuration. Tried jetty-6.1.14with the same result.

        Show
        Paudi Moriarty added a comment - Interesting, this was observed in FF2 and FF3 on Linux and IE6 on Windows. I haven't seen it work with any browser which lends credence to your suggestion of server interference. I'm using the maven-jetty-plugin to run jetty-6.1.11 with no custom configuration. Tried jetty-6.1.14with the same result.
        Hide
        Howard M. Lewis Ship added a comment -

        Unable to get it to reproduce on Mac OS X at all (FF3 and IE6), with the compression verified using FireBug and the Java debugger.

        See notes here: http://www.ruby-forum.com/topic/149617

        I suspect there's a misconfigured server between your Tapestry application and your client that is responsible for the garbling.

        I'll leave this open a little bit longer, but right now it is headed for "could not reproduce".

        Workaround: contribute "application/json" to the ResponseCompressionAnalyzer; this will identify the content as not compressable, which is what you want.

        Show
        Howard M. Lewis Ship added a comment - Unable to get it to reproduce on Mac OS X at all (FF3 and IE6), with the compression verified using FireBug and the Java debugger. See notes here: http://www.ruby-forum.com/topic/149617 I suspect there's a misconfigured server between your Tapestry application and your client that is responsible for the garbling. I'll leave this open a little bit longer, but right now it is headed for "could not reproduce". Workaround: contribute "application/json" to the ResponseCompressionAnalyzer; this will identify the content as not compressable, which is what you want.
        Hide
        Howard M. Lewis Ship added a comment -

        Have to retest; forgot that my test app disabled GZIP compression entirely!

        Show
        Howard M. Lewis Ship added a comment - Have to retest; forgot that my test app disabled GZIP compression entirely!
        Hide
        Howard M. Lewis Ship added a comment -

        Correction: IE 6 on Mac OS X does work. Not sure why I got a negative earlier; may have been junk stored in the local cache.

        Show
        Howard M. Lewis Ship added a comment - Correction: IE 6 on Mac OS X does work. Not sure why I got a negative earlier; may have been junk stored in the local cache.
        Hide
        Howard M. Lewis Ship added a comment -

        IE 7 on Windows works correctly.

        I really think this is just an IE 6 issue.

        Show
        Howard M. Lewis Ship added a comment - IE 7 on Windows works correctly. I really think this is just an IE 6 issue.
        Hide
        Howard M. Lewis Ship added a comment -

        FireFox 2 on Windows works correctly.

        Show
        Howard M. Lewis Ship added a comment - FireFox 2 on Windows works correctly.
        Hide
        Howard M. Lewis Ship added a comment -

        I suspect the problem is the content type; application/json is technically correct but is not on the list in the Prototype documentation.

        Show
        Howard M. Lewis Ship added a comment - I suspect the problem is the content type; application/json is technically correct but is not on the list in the Prototype documentation.
        Hide
        Howard M. Lewis Ship added a comment -

        This doesn't reproduce under FireFox 3, Mac OS X.

        Use IE 6 on Mac OS X I can see a problem, which I assume to be THE problem.

        Show
        Howard M. Lewis Ship added a comment - This doesn't reproduce under FireFox 3, Mac OS X. Use IE 6 on Mac OS X I can see a problem, which I assume to be THE problem.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Paudi Moriarty
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development