4 Replies Latest reply on Nov 3, 2009 8:53 AM by nbelaevski

    Problems in Richfaces PERFORMANCE TUNING

    tchoesang

      I am making intensive use of richfaces component and JS widgets on my web project and I am working on how to enhance the performance.

      All the codes are loaded at once.

      <context-param>
       <param-name>org.richfaces.LoadStyleStrategy</param-name>
       <param-value>ALL</param-value>
       </context-param>
       <context-param>
       <param-name>org.richfaces.LoadScriptStrategy</param-name>
       <param-value>ALL</param-value>
       </context-param>
      


      I suppose the following takes the white spaces away.
      <context-param>
       <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
       <param-value>NEKO</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.xmlparser.NEKO</param-name>
       <param-value>.*\..*</param-value>
       </context-param>
      
      


      Added custom filters to my web resources and defined custom expiry date on the header with a unique ETag.
      <servlet>
       <servlet-name>fileServlet</servlet-name>
       <servlet-class>it.unibz.ict.utils.FileServlet</servlet-class>
       <init-param>
       <param-name>basePath</param-name>
       <param-value>/resources/</param-value>
       </init-param>
      </servlet>
      <servlet-mapping>
       <servlet-name>fileServlet</servlet-name>
       <url-pattern>/resources/*</url-pattern>
      </servlet-mapping>
      


      A4J Filter with force parsing to false and cache is true.
      <filter>
       <filter-name>A4JFilter</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       <!-- No force parsing & enable cache-->
       <init-param>
       <param-name>forceparser</param-name>
       <param-value>false</param-value>
       </init-param>
       <init-param>
       <param-name>enable-cache</param-name>
       <param-value>true</param-value>
       </init-param>
       </filter>
      


      Still after adding the above configurations, I still face the following performance problems: (using firebug in ff3.5.4)

      Richfaces components are not gzipped and are not cached in FF even though by default this cache lasts only 1 day (max-age=86400).
      I found this thread on jira but I didnt understood how they solved it. https://jira.jboss.org/jira/browse/RF-7452
      http://localhost:8080/project/a4j/g/3_3_1.GA/org/richfaces/ui.pack.js.jsf
      Server: Apache-Coyote/1.1
      Cache-Control: max-age=86400
      Last-Modified: Mon, 02 Nov 2009 09:15:51 GMT
      Expires: Tue, 03 Nov 2009 09:16:08 GMT
      Content-Type: text/javascript
      Content-Length: 637479
      Date: Mon, 02 Nov 2009 09:16:07 GMT

      Is there any way to custom define the expiry date of the cache and gzip the richfaces files?


        • 1. Re: Problems in Richfaces PERFORMANCE TUNING
          nbelaevski

          Hi,

          RF-7452 was investigated and confirmed as not a bug of RF - read comments in the issue.

          • 2. Re: Problems in Richfaces PERFORMANCE TUNING
            nbelaevski

            Check RF documentation for expiry date configuration.

            • 3. Re: Problems in Richfaces PERFORMANCE TUNING
              tchoesang

              Hi Nick!
              Thank you for pointing me toward right direction. I have now added a 2 month expiry date on the richfaces components header and gzipped css/js on Tomcat.

              After testing it through firebug/yslow on FF3.5, I wanted further performance improvements.
              I found the following jira issue: https://jira.jboss.org/jira/browse/RF-1941

              *** 3. new script/style load strategy - "only required as in DEFAULT but in a single file as in ALL" ***

              I am very much facinated by the above idea of downloading as bundle only the needed script and css files.
              I saw next this wiki https://www.jboss.org/community/wiki/MavenResourceDependencyPluginReference

              but was later followed by this forum question http://www.jboss.org/index.html?module=bb&op=viewtopic&t=160965 and 2 jira issues by you
              https://jira.jboss.org/jira/browse/RF-7846
              https://jira.jboss.org/jira/browse/RF-7848

              Before I go on and configure my project based on the wiki on MavenResourceDependencyPluginReference, I would like to know whether it works or is it better to wait?

              I appreciate the spirit of richfaces developers in excelling for performance.

              much compliments!

              Choesang


              • 4. Re: Problems in Richfaces PERFORMANCE TUNING
                nbelaevski

                Hi Choesang,

                It works, please give it a try.