Search code examples
compressionwebserverweblogic

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.


Solution

  • 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>