Configuration GZip at Wildfly

前端 未结 3 2148
温柔的废话
温柔的废话 2021-02-07 15:08

I\'m with a problem to configure the GZip in my Wildfly server used the following configuration on the server:



        
3条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 15:49

    Expanding on Alexander's answer I did some tests. Strangely enough the predicate to only compress files larger then 500 bytes is not min-content-size[500].

    To configure it using jboss-cli.sh run this script:

    /subsystem=undertow/configuration=filter/gzip=gzipFilter:add()
    /subsystem=undertow/server=default-server/host=default-host/\
       filter-ref=gzipFilter:add(predicate="not min-content-size[500]")
    

    Note that the gzip filter will start to work after server reload. You can do this using cli's command :reload.

    To test if the filter is enabled I used:

    wget $MY_URL -S --header="accept-encoding: gzip" \
      -O /dev/null 2>&1| grep Content-Encoding
    

提交回复
热议问题