Compression 要在Weblogic中启用GZip压缩吗

Compression 要在Weblogic中启用GZip压缩吗,compression,webserver,weblogic,Compression,Webserver,Weblogic,我想为静态文件(如css样式)启用GZIP压缩,javascript是从weblogic服务器提供的。任何人都可以帮助您在weblogic server中配置此功能。转到下载它,并使用以下配置更新您的web.xml文件: <filter> <filter-name>CompressingFilter</filter-name> <filter-class>com.planetj.servlet.filter.compression.

我想为静态文件(如css样式)启用GZIP压缩,javascript是从weblogic服务器提供的。任何人都可以帮助您在weblogic server中配置此功能。

转到下载它,并使用以下配置更新您的web.xml文件:

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

压缩滤波器
com.planetj.servlet.filter.compression.CompressingFilter
includeContentTypestext/html、text/css、application/x-javascript
压缩阈值256
压缩滤波器
/*
为Web应用程序配置GZIP压缩 您可以在域级别或Web应用程序级别启用和配置内容编码GZIP压缩。特定Web应用程序的值将覆盖域级别的值。 要为域中的所有Web应用程序配置GZIP压缩,请执行以下操作:

  • 如果尚未执行此操作,请在 管理控制台,单击锁定和编辑
  • 在域结构树中,选择您的域
  • 选择配置>Web应用程序
  • 为定义以下域Web应用程序配置设置 GZIP压缩:
    • 已启用GZIP压缩:为所有Web应用程序启用或禁用GZIP压缩。默认情况下,此值未启用
    • GZIP压缩最小内容长度:配置最小内容长度以触发GZIP压缩。默认值为2048
    • GZIP压缩内容类型:配置要包括在压缩中的内容类型。默认值为text/html、text/xml、text/plain。单击“保存”保存所有更改
  • 要激活这些更改,请在管理控制台的更改中心,单击激活更改
    并非所有更改都会立即生效,有些更改需要重新启动()

  • 我使用的额外内容类型包括默认值:text/html-text/xml-text/plain-text/css-application/xml-application/xhtml+xml-application/rss+xml-application/javascript-application/x-javascript