Problems in Richfaces PERFORMANCE TUNING
tchoesang Nov 2, 2009 4:28 AMI 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?