2 Replies Latest reply on Oct 14, 2013 3:02 PM by Amit Tikoo

    JSF/ RIchfaces Performance on Google Chrome due to HTTP 304 responses

    Amit Tikoo Newbie

      We are creating an application using JSF 2.0 / Richfaces 4.2.2. The page is loading fast in IE9(3-4 secs) but is painfully slow in Chrome.

      Looking at the Network the problem seems to be that for most JSF & Richfaces resources, the browser gets a 304 response but it is talking long(I'm talking minutes) to finally get these resources.

      My web.xml:

      <context-param>

      <description> Set the max time in miliseconds set on the "Expires" header for a resource rendered by the default ResourceHandler. </description>

      <param-name>org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES</param-name>

      <param-value>2592000000</param-value><!-- 30 Days --> </context-param>

      <!-- RichFaces -->

      <context-param>

      <description>Defines in seconds how long streamed back to browser resources can be cached.</description>

      <param-name>org.ajax4jsf.DEFAULT_EXPIRE</param-name>

      <param-value>2592000</param-value><!-- 30 Days -->

      </context-param> 

      <context-param>

      <param-name>org.richfaces.resourceOptimization.enabled</param-name>

      <param-value>false</param-value> </context-param> <context-param>

      <param-name>org.richfaces.LoadScriptStrategy</param-name>

      <param-value>ALL</param-value>

      </context-param>

      <context-param>

      <param-name>org.richfaces.LoadStyleStrategy</param-name>

      <param-value>ALL</param-value> </context-param> <context-param

      > <!-- If org.richfaces.LoadScriptStrategy is set to ALL, this should be false -->

      <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>

      <param-value>false</param-value>

      </context-param>

      Sample request/response for one of the resources(Chrome)

      Request URL:http://localhost/weblogicOMIA1003/APOMIA1003/faces/javax.faces.resource/calendar.js?ln=org.richfaces

      Request Method:GET Status Code:304 Not Modified Request Headersview source

      Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8

      Cache-Control:max-age=0

      Connection:keep-alive Cookie:JSESSIONID=RTJDSDYGFNnmDSVLySxVMJBJyhhm2GKSLtwPXmLtllqy9xh1MJjY!1711646894

      Host:10.42.100.123 If-Modified-Since:Wed, 17 Oct 2012 18:13:54 GMT

      Referer:http://10.42.100.123/weblogicOMIA1003/APOMIA1003/faces/analytics/trends/BasicTrends.xhtml?NODEID=545&STATEID=USGVDATIKOO1.e.p.hlzjqo1s462

      User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36

      Query String Parametersview sourceview URL encoded ln:org.richfaces Response

      Headersview source X-Powered-By:Servlet/3.0 JSP/2.2 X-Powered-By:JSF/2.0 X-UA-Compatible:IE=edge