通过XML配置在Glassfish中启用gzip压缩

sea*_*ean 2 compression gzip glassfish http-compression

这里有各种各样回答了这个问题,其通过管理控制台解决它.我想通过Glassfish的XML配置启用它,但没有找到任何有关此功能的文档.

unw*_*ich 6

您可以domain.xmlnetwork-config- > 下设置它protocols

例:

<protocol name="http-listener-1">
  <http default-virtual-server="server" max-connections="250" 
    compressable-mime-type="text/html,text/xml,text/plain,text/javascript" compression="on" compression-min-size-bytes="4096">
  <file-cache></file-cache>
  </http>
</protocol>
Run Code Online (Sandbox Code Playgroud)