Want to enable GZip compression in Weblogic

后端 未结 2 953
再見小時候
再見小時候 2021-01-02 21:08

I want to enable GZIP compression for my static file like css styles, javascript which is serving from weblogic server. Can anyone help to how to configure this feature in w

相关标签:
2条回答
  • 2021-01-02 21:40

    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>
    
    0 讨论(0)
  • 2021-01-02 21:41

    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).
    0 讨论(0)
提交回复
热议问题