[KULRICE-7357] Handle naming of JS files to avoid problems caused by cached JS files Created: 22/May/12 Updated: 03/Apr/13 Resolved: 14/Aug/12
|Project:||Kuali Rice Development|
|Fix Version/s:||2.2.0-m4, 2.2|
|Security Level:||Public (Public: Anyone can view)|
|Reporter:||Cassy Beekman (Inactive)||Assignee:||Matthew Wuertz (Inactive)|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|KAI Review Status:||Not Required|
|KTI Review Status:||Not Required|
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.
|Comment by Jerry Neal (Inactive) [ 22/May/12 ]|
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?
|Comment by Cassy Beekman (Inactive) [ 22/May/12 ]|
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!
|Comment by Jerry Neal (Inactive) [ 03/Jul/12 ]|
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
. 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.
|Comment by Eric Westfall [ 02/Aug/12 ]|
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.
|Comment by Travis Schneeberger [ 02/Aug/12 ]|
Specifically, I'm referring to the "cache" files.
|Comment by Matthew Wuertz (Inactive) [ 14/Aug/12 ]|
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.