Note that there are some explanatory texts on larger screens.

plurals
  1. PORichFaces resources take minutes to load and return 304 response in Chrome
    primarykey
    data
    text
    <p>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.</p> <p>Looking at the Network the problem seems to be that for most JSF &amp; Richfaces resources, the browser gets a 304 response but it is talking long(I'm talking minutes) to finally get these resources. </p> <p>My web.xml:</p> <pre><code>&lt;context-param&gt; &lt;description&gt; Set the max time in miliseconds set on the "Expires" header for a resource rendered by the default ResourceHandler. &lt;/description&gt; &lt;param-name&gt;org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES&lt;/param-name&gt; &lt;param-value&gt;2592000000&lt;/param-value&gt;&lt;!-- 30 Days --&gt; &lt;/context-param&gt; &lt;!-- RichFaces --&gt; &lt;context-param&gt; &lt;description&gt;Defines in seconds how long streamed back to browser resources can be cached.&lt;/description&gt; &lt;param-name&gt;org.ajax4jsf.DEFAULT_EXPIRE&lt;/param-name&gt; &lt;param-value&gt;2592000&lt;/param-value&gt;&lt;!-- 30 Days --&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.resourceOptimization.enabled&lt;/param-name&gt; &lt;param-value&gt;false&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.LoadScriptStrategy&lt;/param-name&gt; &lt;param-value&gt;ALL&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.LoadStyleStrategy&lt;/param-name&gt; &lt;param-value&gt;ALL&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;!-- If org.richfaces.LoadScriptStrategy is set to ALL, this should be false --&gt; &lt;param-name&gt;org.ajax4jsf.COMPRESS_SCRIPT&lt;/param-name&gt; &lt;param-value&gt;false&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>Sample request/response for one of the resources(Chrome)</p> <pre><code>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&amp;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 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COApart of different timing, are there any differences in request/response when done from IE? What about other browsers (FF, IE8-)?
      singulars
    2. COThanks for the response. We areonly supporting IE9 and CHrome. I did compare the HTTP request responses for both IE9 and Chrome for the same resource: CHROME: Response Headers: X-Powered-By:Servlet/3.0 JSP/2.2 X-Powered-By:JSF/2.0 X-UA-Compatible:IE=edge IE: Key Value Response HTTP/1.1 304 Not Modified Transfer-Encoding chunked Content-Type text/javascript X-Powered-By Servlet/3.0 JSP/2.2 X-Powered-By JSF/2.0 X-UA-Compatible IE=edge Expires Thu, 07 Nov 2013 16:24:28 GMT Last-Modified Wed, 17 Oct 2012 18:04:34 GMT I can't fathom why IE would get the Expires header while chrome does not.
      singulars
    3. COI only can think of that there is some logic reading user agent on server side and doing one or another thing depending on that. Try in Chrome dev tools -> Settings -> Overrides -> User Agent checkbox -> try different values. Despite you are supporting IE9 and Chrome only, try testing other user agents as well, it might give an insight of what is going on. Most interesting is request data, as depending on this server decides to go one way or another, playing with request data you should be able to localize what is causing the difference.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload