ICEfaces
  1. ICEfaces
  2. ICE-6928

ICEfaces not caching core compat and ace javascript

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.2
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Regular ICEfaces, ICEfaces with Compat, and ICEfaces with ACE

      Description

      When loading or refreshing a page, the browser is fetching all the javascript, which should instead be cached.

        Activity

        Hide
        Mark Collette added a comment - - edited

        What's supposed to happen is that when a JSF 2 application is in Development stage, the resources are not cached. Then, when in Production stage, they are cached, for a default of 10 minutes. Mojarra configures the duration with this context param:

        <context-param>
        <param-name>com.sun.faces.defaultResourceMaxAge</param-name>
        <param-value>604800</param-value>
        </context-param>

        And the project stage is set via this context param:

        <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
        </context-param>

        Perversely, what I'm seeing is that when using Development stage, the resources are being cached, and when in Production stage they are only being cached when clicking to refresh, but are not cached when clicking outputLinks to GET different pages in the application. Tested by browsing from page to page within ace-showcase. Issue shows up even when not clicking to a different page, but also when repeatedly clicking to show the current page. Setting com.sun.faces.defaultResourceMaxAge or not doesn't seem to affect this immediate caching defect.

        Show
        Mark Collette added a comment - - edited What's supposed to happen is that when a JSF 2 application is in Development stage, the resources are not cached. Then, when in Production stage, they are cached, for a default of 10 minutes. Mojarra configures the duration with this context param: <context-param> <param-name>com.sun.faces.defaultResourceMaxAge</param-name> <param-value>604800</param-value> </context-param> And the project stage is set via this context param: <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Production</param-value> </context-param> Perversely, what I'm seeing is that when using Development stage, the resources are being cached, and when in Production stage they are only being cached when clicking to refresh, but are not cached when clicking outputLinks to GET different pages in the application. Tested by browsing from page to page within ace-showcase. Issue shows up even when not clicking to a different page, but also when repeatedly clicking to show the current page. Setting com.sun.faces.defaultResourceMaxAge or not doesn't seem to affect this immediate caching defect.
        Hide
        Mark Collette added a comment - - edited

        Following Deryk's suggestion, I've enabled tomcat's access logging, by uncommenting this from server.xml:

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
        prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>

        The reason being that Firebug's Net tab seems to be lying about what it's getting from it's cache versus what it's going to the server for.

        So, let's go through a few scenarios.

        ace-showcase, PROJECT_STAGE=Production, deployed=Yesterday, Browser=Firefox 3.6.13

        1. SHIFT-REFRESH of dateTimeEntry.jsf
        Firebug: 200 * [Good]
        Tomcat: 200 * [Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Firebug: 200 * [Bad]
        Tomcat: No access except 200 dateTimeEntry.jsf [Good]

        3. RERESH of dateTimeEntry.jsf
        Firebug: 304 * [Good]
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Firebug: 200 * [Bad]
        Tomcat: No access except 200 sliderEntry.jsf [Good]

        ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=Firefox 3.6.13

        1. SHIFT-REFRESH of dateTimeEntry.jsf
        Firebug: 200 * [Good]
        Tomcat: 200 * [Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Firebug: 304 * [Good]
        Tomcat: 304 * [Good]

        3. RERESH of dateTimeEntry.jsf
        Firebug: 304 * [Good]
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Firebug: 304 core mandatory, 200 yui_loaded * [Bad-ish]
        Tomcat: 304 * [Good]

        Show
        Mark Collette added a comment - - edited Following Deryk's suggestion, I've enabled tomcat's access logging, by uncommenting this from server.xml: <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> The reason being that Firebug's Net tab seems to be lying about what it's getting from it's cache versus what it's going to the server for. So, let's go through a few scenarios. ace-showcase, PROJECT_STAGE=Production, deployed=Yesterday, Browser=Firefox 3.6.13 1. SHIFT-REFRESH of dateTimeEntry.jsf Firebug: 200 * [Good] Tomcat: 200 * [Good] 2. Click outputLink to GET dateTimeEntry.jsf Firebug: 200 * [Bad] Tomcat: No access except 200 dateTimeEntry.jsf [Good] 3. RERESH of dateTimeEntry.jsf Firebug: 304 * [Good] Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Firebug: 200 * [Bad] Tomcat: No access except 200 sliderEntry.jsf [Good] ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=Firefox 3.6.13 1. SHIFT-REFRESH of dateTimeEntry.jsf Firebug: 200 * [Good] Tomcat: 200 * [Good] 2. Click outputLink to GET dateTimeEntry.jsf Firebug: 304 * [Good] Tomcat: 304 * [Good] 3. RERESH of dateTimeEntry.jsf Firebug: 304 * [Good] Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Firebug: 304 core mandatory, 200 yui_loaded * [Bad-ish] Tomcat: 304 * [Good]
        Hide
        Mark Collette added a comment -

        ace-showcase, PROJECT_STAGE=Production, deployed=Now, Browser=Safari 5.0.5

        1. SHIFT-REFRESH of dateTimeEntry.jsf
        Tomcat: 200 * [Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Tomcat: No access except 200 dateTimeEntry.jsf [Good]

        3. RERESH of dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Tomcat: No access except 200 sliderEntry.jsf and other resources specific to sliderEntry not accessed yet [Good]

        ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=Safari 5.0.5

        1. SHIFT-REFRESH of dateTimeEntry.jsf
        Tomcat: 200 * [Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        3. RERESH of dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Tomcat: 304 * [Good]

        Show
        Mark Collette added a comment - ace-showcase, PROJECT_STAGE=Production, deployed=Now, Browser=Safari 5.0.5 1. SHIFT-REFRESH of dateTimeEntry.jsf Tomcat: 200 * [Good] 2. Click outputLink to GET dateTimeEntry.jsf Tomcat: No access except 200 dateTimeEntry.jsf [Good] 3. RERESH of dateTimeEntry.jsf Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Tomcat: No access except 200 sliderEntry.jsf and other resources specific to sliderEntry not accessed yet [Good] ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=Safari 5.0.5 1. SHIFT-REFRESH of dateTimeEntry.jsf Tomcat: 200 * [Good] 2. Click outputLink to GET dateTimeEntry.jsf Tomcat: 304 * [Good] 3. RERESH of dateTimeEntry.jsf Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Tomcat: 304 * [Good]
        Hide
        Mark Collette added a comment -

        ace-showcase, PROJECT_STAGE=Production, deployed=Now, Browser=IE 7

        1. CONTROL-REFRESH of dateTimeEntry.jsf
        Tomcat: 200 * [Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Tomcat: No access except 200 dateTimeEntry.jsf [Good]

        3. RERESH of dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Tomcat: No access except 200 sliderEntry.jsf and other resources specific to sliderEntry not accessed yet [Good]

        ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=IE 7

        1. CONTROL-REFRESH of dateTimeEntry.jsf
        Tomcat: 200 for page resources, 304 for YUI3 loaded resources [Efficient, not necessarily Good]

        2. Click outputLink to GET dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        3. RERESH of dateTimeEntry.jsf
        Tomcat: 304 * [Good]

        4. Click on outputLink to GET sliderEntry.jsf
        Tomcat: 304 * [Good]

        Show
        Mark Collette added a comment - ace-showcase, PROJECT_STAGE=Production, deployed=Now, Browser=IE 7 1. CONTROL-REFRESH of dateTimeEntry.jsf Tomcat: 200 * [Good] 2. Click outputLink to GET dateTimeEntry.jsf Tomcat: No access except 200 dateTimeEntry.jsf [Good] 3. RERESH of dateTimeEntry.jsf Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Tomcat: No access except 200 sliderEntry.jsf and other resources specific to sliderEntry not accessed yet [Good] ace-showcase, PROJECT_STAGE=Development, deployed=Now, Browser=IE 7 1. CONTROL-REFRESH of dateTimeEntry.jsf Tomcat: 200 for page resources, 304 for YUI3 loaded resources [Efficient, not necessarily Good] 2. Click outputLink to GET dateTimeEntry.jsf Tomcat: 304 * [Good] 3. RERESH of dateTimeEntry.jsf Tomcat: 304 * [Good] 4. Click on outputLink to GET sliderEntry.jsf Tomcat: 304 * [Good]
        Hide
        Mark Collette added a comment -

        So, there doesn't seem to be any problem with the caching, as tested in ace-showcase. The only thing that would indicate a problem, is that Firebug lies about getting resources, which Tomcat shows it is not re-getting.

        http://wiki.icefaces.org/display/ICE/JSF+Configuration

        Show
        Mark Collette added a comment - So, there doesn't seem to be any problem with the caching, as tested in ace-showcase. The only thing that would indicate a problem, is that Firebug lies about getting resources, which Tomcat shows it is not re-getting. http://wiki.icefaces.org/display/ICE/JSF+Configuration

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: