0

To be able to display the download status in a java application, I need to disable GZIP compression on a wildfly 10 server. It seems to be enabled by default. I found a lot of pages on how to enable it, nothing to disable it. Any clue ?

EDIT

I tried removing completely gzip filter from config as you can see below. The files I download (3 MB) are still compressed during transfert

    <subsystem xmlns="urn:jboss:domain:undertow:3.1" statistics-enabled="true">
        <buffer-cache name="default"/>
        <server name="default-server">
            <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
            <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
            <host name="default-host" alias="localhost">
                <location name="/" handler="welcome-content"/>
                <filter-ref name="server-header"/>
                <filter-ref name="x-powered-by-header"/>
            </host>
        </server>
        <servlet-container name="default">
            <jsp-config/>
            <websockets/>
        </servlet-container>
        <handlers>
            <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
        </handlers>
        <filters>
            <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
            <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
        </filters>
    </subsystem>
parser_failed
  • 697
  • 9
  • 20
  • You turn it on via a filter in the configuration, right? So if you remove that filter, it would turn it off, wouldn't it? – Ken White Sep 09 '17 at 17:59
  • I completely removed it from config already. See the config I added to the question – parser_failed Sep 09 '17 at 18:10
  • 1
    And you restarted the server afterward? (I must admit I'm confused by why you're wanting to do this, BTW. You can show progress of the download of the compressed files just as you can the not-compressed files. All you're doing is increasing the amount of data that has to be transferred, which is going to stink for any of your users who are on a metered connection, because it will cost them their data use unnecessarily with the larger transfers. Download the file with compression on using Firefox, Chrome, IE or Edge; they all show progress even with the compressed files.) – Ken White Sep 09 '17 at 18:18
  • Even rebooted the server :) In Java (haven't tried on others langages), when you try to get the http response size, you get -1 if the http-compression is active, which make it impossible to update an user interface on the download progress. So far I could not find any workaround other than disabling gzip compression – parser_failed Sep 09 '17 at 18:31
  • `I found a lot of pages on how to enable it`, because it's not enabled by default. The default configs don't mention gzip at all. You have to explicitly add the filter. How you determine that it's enabled? – Vsevolod Golovanov Sep 17 '17 at 13:05
  • `In Java (haven't tried on others langages), when you try to get the http response size...` Java the programming language is not concerned with HTTP, doesn't even know about its existence. This is up to libraries that you use. – Vsevolod Golovanov Sep 17 '17 at 13:09
  • Most likely, your problem stems from the servlet or whatever that serves your downloads. It probably doesn't fill the necessary HTTP headers. – Vsevolod Golovanov Sep 17 '17 at 13:11
  • @VsevolodGolovanov, I had it activated. When the requirements changed i reverted config. Stilll the http headers comes with GZIP compression enabled despite specifically told to use identity encoding. I'm using Java's URLConnection implementation, not a third party lib. – parser_failed Sep 18 '17 at 18:50
  • @VsevolodGolovanov I rechecked and I can't find anything related to compression in the servlet's code nor header manipulation – parser_failed Sep 18 '17 at 18:54
  • @parser_failed, `http headers comes with GZIP compression enabled` where do you see this header and what does it look like exactly? – Vsevolod Golovanov Sep 19 '17 at 07:43

0 Answers0