Want to enable GZip compression in Weblogic

偶尔善良 提交于 2019-11-30 20:23:50

Go to http://sourceforge.net/projects/pjl-comp-filter/ to download it and update your web.xml file with the following config:

<filter>
    <filter-name>CompressingFilter</filter-name>
    <filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class>
    <init-param><param-name>includeContentTypes</param-name><param-value>text/html,text/css,application/x-javascript</param-value></init-param>
    <init-param><param-name>compressionThreshold</param-name><param-value>256</param-value></init-param>
</filter>

<filter-mapping>
    <filter-name>CompressingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

Configure GZIP compression for Web applications

You can enable and configure content-encoding GZIP compression at the domain level or Web application level. Values for a specific Web application override domain-level values. To configure GZIP compression for all Web applications in the domain:

  1. If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit (see Use the Change Center).
  2. In the Domain Structure tree, select your domain.
  3. Select Configuration > Web Applications.
  4. Define the following domain-wide Web application configuration settings for GZIP compression:
    • GZIP Compression Enabled: enable or disable GZIP compression for all Web applications. By default, this value is not enabled.
    • GZIP Compression Min. Content Length: configure the minimum content length to trigger GZIP compression. The default value is 2048.
    • GZIP Compression Content Type: configure the type of content to be included in compression. The default value is text/html, text/xml, text/plain. Click Save to save any changes.
  5. To activate these changes, in the Change Center of the Administration Console, click Activate Changes.
    Not all changes take effect immediately—some require a restart (see Use the Change Center).
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!