Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to enable GZip compression in Weblogic

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 weblogic server.

like image 305
vinoth Avatar asked Jan 05 '12 12:01

vinoth


2 Answers

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>
like image 152
JoséMi Avatar answered Nov 02 '22 07:11

JoséMi


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).
like image 7
deenaik Avatar answered Nov 02 '22 07:11

deenaik