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

时间:2013-02-20 19:07:43

标签: glassfish compression gzip http-compression

此问题有variety answers,可通过管理控制台解决此问题。我想通过Glassfish的XML配置启用它,但没有找到任何有关此功能的文档。

1 个答案:

答案 0 :(得分:6)

您可以在domain.xml - >下的network-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>