Skip to content

Activate GZip Compression for QIDO and WADO Metadata responses in Wildfly

Vrinda edited this page Mar 27, 2023 · 1 revision

Overview

For cases wherein responses for WADO RS metadata and QIDO may be too large, this can be compressed using Undertow settings in Wildfly. This enables the client to accept responses compressed and deflate it later on their systems.

Configuration

  • Set filter settings in archive's Wildfly using JBoss CLI in a new console window :

      > $WILDFLY_HOME/bin/jboss-cli.sh -c [UNIX]
      > %WILDFLY_HOME%\bin\jboss-cli.bat -c [Windows]
      [standalone@localhost:9990 /] /subsystem=undertow/configuration=filter/gzip=gzipFilter/:add
      [standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/filter-ref=gzipFilter/:add(predicate="method(GET) and path-suffix(studies,series,instances,metadata)")
    

Test

  • Invoke QIDO Search for Studies service requesting response to be compressed in gzip format using curl

    $ curl -v -o /tmp/studies.json.gz -H "Accept-Encoding: gzip" \
      http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:8080...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 8080 (#0)
    > GET /dcm4chee-arc/aets/DCM4CHEE/rs/studies HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.68.0
    > Accept: */*
    > Accept-Encoding: gzip
    > 
      0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0* Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Content-Encoding: gzip
    < Cache-Control: no-cache
    < Access-Control-Allow-Headers: origin, content-type, accept, authorization
    < Date: Fri, 02 Oct 2020 08:59:42 GMT
    < Connection: keep-alive
    < Access-Control-Allow-Origin: *
    < Access-Control-Allow-Credentials: true
    < Transfer-Encoding: chunked
    < Content-Type: application/dicom+json
    < Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
    < 
    { [953 bytes data]
    100   945    0   945    0     0    621      0 --:--:--  0:00:01 --:--:--   621
    * Connection #0 to host localhost left intact
    

    and gunzip the compressed file to view the JSON response

    $ gunzip /tmp/studies.json.gz
    
  • Invoke WADO Retrieve Study Metadata service requesting response to be compressed in gzip format using curl

    $ curl -v -o /tmp/metadata.json.gz -H "Accept-Encoding: gzip" \
      http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.3.12.2.1107.5.8.3.485251.834954.83838049.2020073010062484/metadata
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:8080...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 8080 (#0)
    > GET /dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.3.12.2.1107.5.8.3.485251.834954.83838049.2020073010062484/metadata HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.68.0
    > Accept: */*
    > Accept-Encoding: gzip
    > 
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Content-Encoding: gzip
    < Access-Control-Allow-Headers: origin, content-type, accept, authorization
    < Date: Fri, 02 Oct 2020 07:46:53 GMT
    < Connection: keep-alive
    < Access-Control-Allow-Origin: *
    < ETag: "-1169093424"
    < Last-Modified: Wed, 23 Sep 2020 09:35:08 GMT
    < Access-Control-Allow-Credentials: true
    < Transfer-Encoding: chunked
    < Content-Type: application/dicom+json
    < Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
    < 
    { [1577 bytes data]
    100  1579    0  1579    0     0   5762      0 --:--:-- --:--:-- --:--:--  5741
    * Connection #0 to host localhost left intact
    

    and gunzip the compressed file to view the JSON response

    $ gunzip /tmp/metadata.json.gz
    
Clone this wiki locally