Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-7357

Handle naming of JS files to avoid problems caused by cached JS files

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-m4, 2.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-6417License header update causing syntax problems in JS files
      KULRICE-8400JS error in adding note/attachment
      KULRICE-8690Uif-BaseTheme-parentBean defaults to minimized js which are difficult to debug
      KULRICE-11453Maintenance Conversion Script - M22 Additional JS File
      KULRICE-6438Create folder structure for custom, library and modified library js files
      KULRICE-9827Split Js files further into other functional areas
      KULRICE-3985portalTop tag only works with a single portal CSS/JS file
      KULRICE-5330Web files (css and JS) need to be combined and minified for war production deployment
      KULRICE-8155JS error going to collections page
      KULRICE-9608URL updating for back button support causes problems with resource caching
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      When ks-1.3 was upgraded to Rice 2.2.0, we found that all of our devs and testers had to manually clear their browser caches, because the Rice upgrade depended upon changes in the JS files that were not being pulled in due to caching.

      Garey mentioned this in the KS Devs as a possible way to handle this:

      [5/21/2012 10:07:10 AM] Garey: Yeah, it's caching. So, with the Rice upgrade I think some of the underlying js files were changed. JS files are permanently cached. GWT got around this by generating all js file names at compile time based off of a hash code, which ensured you never used stale / cached classes.
      [5/21/2012 10:08:08 AM] Garey: Note: this will be a a BIG pain for users in the future.

        Activity

        Hide
        Jerry Neal (Inactive) added a comment -

        Cassy,

        We can due this but I am wondering if the development side is that big of a problem? For users, we have minified CSS and JS files that get generated. We can add a hash so those get downloaded for a new release. For the individual files that developers use, we would need to write something that modified the file names and all the includes, which would be a bit of work and probably low priority compared to other issues.

        So just wanted to see if you agreed the user part is the critical issue, and for developers not as much?

        thanks,
        Jerry

        Show
        Jerry Neal (Inactive) added a comment - Cassy, We can due this but I am wondering if the development side is that big of a problem? For users, we have minified CSS and JS files that get generated. We can add a hash so those get downloaded for a new release. For the individual files that developers use, we would need to write something that modified the file names and all the includes, which would be a bit of work and probably low priority compared to other issues. So just wanted to see if you agreed the user part is the critical issue, and for developers not as much? thanks, Jerry
        Hide
        Cassy Beekman (Inactive) added a comment -

        Hi Jerry, thanks for asking. Yes, agree that it is really the users that we're concerned about. If you have a working solution for them, feel free to downgrade or resolve this one. Thanks!

        Show
        Cassy Beekman (Inactive) added a comment - Hi Jerry, thanks for asking. Yes, agree that it is really the users that we're concerned about. If you have a working solution for them, feel free to downgrade or resolve this one. Thanks!
        Hide
        Jerry Neal (Inactive) added a comment -

        Matt,

        For this one here is what we need to do:

        1) Verify we have all our JS and CSS files listed for the minimize plugin and in the correct order
        2) For the generated JS and CSS min files, add the Rice version to the name. You should be able to reference the maven variable $

        {project.version}

        . This will give our files a new name each release which will force a download

        After this is in place, let's go ahead and change the theme (UifViewPageDefinitions.xml) to use the minified files by default so we are testing this configuration.

        thanks,
        Jerry

        Show
        Jerry Neal (Inactive) added a comment - Matt, For this one here is what we need to do: 1) Verify we have all our JS and CSS files listed for the minimize plugin and in the correct order 2) For the generated JS and CSS min files, add the Rice version to the name. You should be able to reference the maven variable $ {project.version} . This will give our files a new name each release which will force a download After this is in place, let's go ahead and change the theme (UifViewPageDefinitions.xml) to use the minified files by default so we are testing this configuration. thanks, Jerry
        Hide
        Eric Westfall added a comment -

        One article I read talked about using an MD5 hash of the JS file in the name which sounds like a clever approach as it would only change when the contents of the JS file change. Using the version number would work but wouldn't help developers since it's always going to be some snapshot version. The MD5 approach might be more challenging to implement though.

        Show
        Eric Westfall added a comment - One article I read talked about using an MD5 hash of the JS file in the name which sounds like a clever approach as it would only change when the contents of the JS file change. Using the version number would work but wouldn't help developers since it's always going to be some snapshot version. The MD5 approach might be more challenging to implement though.
        Hide
        Travis Schneeberger added a comment -

        Eric,

        Naming based on MD5 is what GWT does with JavaScript files. see: https://developers.google.com/web-toolkit/doc/latest/FAQ_DebuggingAndCompiling

        Specifically, I'm referring to the "cache" files.

        Show
        Travis Schneeberger added a comment - Eric, Naming based on MD5 is what GWT does with JavaScript files. see: https://developers.google.com/web-toolkit/doc/latest/FAQ_DebuggingAndCompiling Specifically, I'm referring to the "cache" files.
        Hide
        Matthew Wuertz (Inactive) added a comment -

        Per Jerry, I changed the files to include the project version in the name. Also, I reordered some of the files so that they would function correctly in minified format.

        Show
        Matthew Wuertz (Inactive) added a comment - Per Jerry, I changed the files to include the project version in the name. Also, I reordered some of the files so that they would function correctly in minified format.

          People

          • Assignee:
            Matthew Wuertz (Inactive)
            Reporter:
            Cassy Beekman (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel