Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ISC_FileLoader and load_skin.js: Loading of load_skin.js and skin_styles not optimal

    Hi Isomorphic,

    I try to get caching 100% right.
    In my plain login.html I use
    Code:
    <script type="text/javascript" language="javascript">var isomorphicDir = "lms/sc/";</script>
    <script type="text/javascript" language="javascript" src="lms/sc/modules/ISC_FileLoader.js"></script>
    <script type="text/javascript" language="javascript">FL.modulesDir = "modules/"; FL.defaultSkin = "Simplicity"; FL.cacheISC();</script>
    This results in calls to:
    Code:
    myproj/sc/skins/Simplicity/load_skin.js
    myproj/sc/skins/Simplicity/skin_styles.css?isc_version=v9.1p_2014-05-25.js


    In my GWT Page (JSP, see hand-coded versionstring below) I have
    Code:
    <script type="text/javascript" src="myproj/sc/skins/Simplicity/load_skin.js<% out.print(version); %>"></script>
    This results in a call to:
    Code:
    /myproj/sc/skins/Simplicity/skin_styles.css

    As you can see this results in four http hits, where it could have been two. Not really a problem, but a fix would be nice.

    Could you
    • Have ISC_FileLoader call load_skin.js with the isc_version-parameter it already uses for the ISC-*.js-files and the skin_styles.css?
    • Have load_skin.js call skin_styles.css the with the isc_version-parameter FileLoader already uses?


    Best regards,
    Blama

    #2
    If you want to manually manage this, just use NoScript/NoTheme versions of the SmartGWT <inherits>.

    Comment


      #3
      I already do inherit com.smartgwt.SmartGwtNoScript in my .gwt.xml.

      Therefore I'm calling the JavaScript ISC_FileLoader.js in my HTML Login code and the other ISC_*.js in my app-page.

      I'm talking about the requests issued by the FileLoader and load_skin.js.

      Best regards,
      Blama

      Comment


        #4
        We'll look at possibly improving this and whether there's an inconsistency in when the FileLoader adds versions to URLs, but to get the URLs consistent with current behavior:

        1. remove the version from the load_skin.js tag you are writing out with your .jsp

        2. modify your load_skin.js file so it includes the version in the URL to the .css file.

        Comment


          #5
          Hi Isomorphic,

          I changed my build.xml to inject the current framework version in load_skin.js, as you suggested. This results in the correct URL (with version-parameter) for skin_styles.css.

          I did not remove the version-tag in my main .jsp-file, as it is more important to me that the load_skin.js-file gets refreshed once it (might have) changed than to save the one http-hit on 1st call.

          Did you examine if you think that ISC_FileLoader should load load_skin.js with a version-parameter as it does for the css file?
          Can you integrate the version string in the load_skin.js file from beginning with your build scripts?

          Best regards,
          Blama

          Comment


            #6
            We've made a change to FileLoader and as of 10.0 it will correctly be adding the cache-busting parameter to load_skin.js as well as skin_styles.css when you call either loadISC() or cacheISC().

            Regards
            Isomorphic Software

            Comment


              #7
              Hi Isomorphic,

              thanks a lot. Will it be backported to 9.1 as well?

              Best regards,
              Blama

              Comment


                #8
                No, the approach from post #4 above should be used for any previous version.

                Comment


                  #9
                  Hi Isomorphic,

                  I can confirm that after switching to 5.0p ISC_FileLoader always adds the version string.

                  With this, I can precache all needed data on the login-screen.

                  Just to let you know: I still have to inject the version string in load_skin.js's call to skin_styles.css (for my main page), though:

                  build.xml Ant task:
                  Code:
                  <replaceregexp file="theme/simplicity/public/sc/skins/Simplicity/load_skin.js" match="skin_styles\.css.*&quot;" replace="skin_styles\.css?isc_version=${sgwtee.buildversion}.js&quot;" byline="true" />
                  This is fine for me as it is already working, but you might want to change that nevertheless for the other users.

                  Thanks for the change & Best regards,
                  Blama

                  Comment


                    #10
                    Hi Isomorphic,

                    adapting my changes to current Tahoe, I noticed this comment in my code.
                    This is still not solved for me in 6.1d.

                    Best regards
                    Blama

                    Comment

                    Working...
                    X