付録E フィルタリングによるHTTPレスポンスの圧縮

サーブレット,JSP,および静的コンテンツへのHTTPリクエストに対するHTTPレスポンスを圧縮する機能を利用できます。この機能を利用することによって,WebコンテナとWebクライアント(ブラウザなど)の間のHTTPレスポンス通信に掛かる時間を削減できます。

HTTPレスポンス圧縮機能については,マニュアル「Cosminexus 機能解説」およびマニュアル「Cosminexus システム構築ガイド」を参照してください。

ここでは,HTTPレスポンス圧縮機能を使用する場合の実装例を示します。

実装例の説明
実装例では,Media-Typeがapplication/efdかつ圧縮しきい値が100バイト以上のHTTPレスポンスに対してgzip形式で圧縮して通信します。使用している環境に合わせて設定を変更してください。詳細は,マニュアル「Cosminexus 機能解説」およびマニュアル「Cosminexus システム構築ガイド」を参照してください。
実装例の内容
太字部分が変更個所になります。

<?xml version="1.0" encoding="SHIFT_JIS"?>

<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>

<web-app>
 <display-name>blc_war</display-name>
<filter>
<filter-name>com.hitachi.software.was.web.ResponseCompressionFilter</filter-name>
<filter-class>com.hitachi.software.was.web.ResponseCompressionFilter</filter-class>
<init-param>
<param-name>url-mapping</param-name>
<param-value>/*=rule1;</param-value>
</init-param>
<init-param>
<param-name>rule1</param-name>
<param-value>application/efd:100;</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>com.hitachi.software.was.web.ResponseCompressionFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
 <servlet>
   <servlet-name>HPTLContainerController</servlet-name>
   <display-name>HPTLContainerController</display-name>
   <servlet-class>jp.co.hitachi.soft.portal.container.ContainerController</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet>
   <servlet-name>jetspeed</servlet-name>
   <display-name>jetspeed</display-name>
   <servlet-class>org.apache.turbine.Turbine</servlet-class>
   <init-param>
     <param-name>properties</param-name>
     <param-value>C:/Program Files/HITACHI/CosmiPortal/conf/TurbineResources.properties</param-value>
   </init-param>
   <init-param>
     <param-name>classname</param-name>
     <param-value>org.apache.jetspeed.services.resources.VariableResourcesService</param-value>
   </init-param>
   <load-on-startup>2</load-on-startup>
 </servlet>
 <servlet>
   <servlet-name>csdc</servlet-name>
   <display-name>csdc</display-name>
   <jsp-file>/js/csdc.jsp</jsp-file>
 </servlet>
 <servlet>
   <servlet-name>HPTLPortletFilterAgent</servlet-name>
   <display-name>HPTLPortletFilterAgent</display-name>
   <servlet-class>jp.co.hitachi.soft.portal.portlet.filter.FilterAgentForIFrame</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCEURFormCooperation</servlet-name>
   <display-name>BLCEURFormCooperation</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.BLCEURFormCooperation</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCDownloadServlet</servlet-name>
   <display-name>BLCDownloadServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.BLCDownloadServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleItemSettingServlet</servlet-name>
   <display-name>BLCSimpleItemSettingServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleItemSettingServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleRouteServlet</servlet-name>
   <display-name>BLCSimpleRouteServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleRouteServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleRegistServlet</servlet-name>
   <display-name>BLCSimpleRegistServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleRegistServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleListServlet</servlet-name>
   <display-name>BLCSimpleListServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleListServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleSaveServlet</servlet-name>
   <display-name>BLCSimpleSaveServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleSaveServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleRepositoryServlet</servlet-name>
   <display-name>BLCSimpleRepositoryServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleRepositoryServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleChoiceEditServlet</servlet-name>
   <display-name>BLCSimpleChoiceEditServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleChoiceEditServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleChoiceListServlet</servlet-name>
   <display-name>BLCSimpleChoiceListServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleChoiceListServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleFormServlet</servlet-name>
   <display-name>BLCSimpleFormServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleFormServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleServlet</servlet-name>
   <display-name>BLCSimpleServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimpleFormSettingServlet</servlet-name>
   <display-name>BLCSimpleFormSettingServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimpleFormSettingServlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>BLCSimplePreviewServlet</servlet-name>
   <display-name>BLCSimplePreviewServlet</display-name>
   <servlet-class>jp.co.Hitachi.soft.blc.simpleform.BLCSimplePreviewServlet</servlet-class>
 </servlet>
 <servlet-mapping>
   <servlet-name>jetspeed</servlet-name>
   <url-pattern>/portal/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
   <servlet-name>jetspeed</servlet-name>
   <url-pattern>/jetspeed/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
   <servlet-name>csdc</servlet-name>
   <url-pattern>/js/csdc.js</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
   <servlet-name>HPTLPortletFilterAgent</servlet-name>
   <url-pattern>/WEB-INF/portlet/filter/servlet/HPTLPortletFilterAgent</url-pattern>
 </servlet-mapping>
 <session-config>
   <session-timeout>30</session-timeout>
 </session-config>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/urlutils</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/urlutils.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/portalac</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/portalac.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/utils</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/utils.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/standard</taglib-uri>
   <taglib-location>/WEB-INF/templates/jsp/tld/template.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/scriptutil</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/scriptutil.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/webssomodule</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/webssomodule.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/api/csdc</taglib-uri>
   <taglib-location>/WEB-INF/cosmi/portal/taglib/csdc.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://soft.hitachi.co.jp/portal/api/navigationbar</taglib-uri>
   <taglib-location>/portlets/navigationmenu/navimenu.tld</taglib-location>
 </taglib>
 <resource-ref>
   <res-ref-name>BLC</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
 </resource-ref>
 <ejb-ref>
   <ejb-ref-name>CSCIWAuthenticationManager</ejb-ref-name>
   <ejb-ref-type>Session</ejb-ref-type>
   <home>jp.co.Hitachi.soft.csciw.definer.server.AuthenticationManagerHome</home>
   <remote>jp.co.Hitachi.soft.csciw.definer.server.AuthenticationManager</remote>
 </ejb-ref>
 <ejb-ref>
   <ejb-ref-name>CSCIWDefinitionServer</ejb-ref-name>
   <ejb-ref-type>Session</ejb-ref-type>
   <home>jp.co.Hitachi.soft.csciw.definer.server.DefinitionServerHome</home>
   <remote>jp.co.Hitachi.soft.csciw.definer.server.DefinitionServer</remote>
 </ejb-ref>
</web-app>