Repository: zeppelin Updated Branches: refs/heads/branch-0.6 aa5068f5e -> 13752e202
[Zeppelin-1229] Add cache buster for zeppelin-web build In order to bust the cache when there is changes to the code of zeppelin-web after build, we are adding hashes at the end of the imported .js and .css files we use. Every time there is changes in one of those file, the hash will change and the browser will use new file instead of cached one. Improvement https://issues.apache.org/jira/browse/ZEPPELIN-1229 * Build zeppelin-web once and write down the HASH in `dist/scripts/scripts.HASH.js` * After making a change inside a .js file of the application and building again, the hash in `dist/scripts/scripts.HASH.js` should be changed. * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Damien CORNEAU <cornead...@gmail.com> Closes #1225 from corneadoug/ZEPPELIN-1229 and squashes the following commits: ebad090 [Damien CORNEAU] Add cache buster for .js and .css file in zeppelin-web production build (cherry picked from commit 848dbd0302a4e6d4917a70c1cbc2220a7a814488) Signed-off-by: Damien CORNEAU <cornead...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/13752e20 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/13752e20 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/13752e20 Branch: refs/heads/branch-0.6 Commit: 13752e2020057da19b4c92a7bca0add38d20e0f5 Parents: aa5068f Author: Damien CORNEAU <cornead...@gmail.com> Authored: Mon Jul 25 14:20:06 2016 +0900 Committer: Damien CORNEAU <cornead...@gmail.com> Committed: Fri Jul 29 15:45:25 2016 +0900 ---------------------------------------------------------------------- zeppelin-web/Gruntfile.js | 26 +++++++++++++++++++++++++- zeppelin-web/package.json | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/13752e20/zeppelin-web/Gruntfile.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js index 5574daf..8204837 100644 --- a/zeppelin-web/Gruntfile.js +++ b/zeppelin-web/Gruntfile.js @@ -56,6 +56,29 @@ module.exports = function (grunt) { } }, + htmlhint: { + options: { + 'tagname-lowercase': true, + 'attr-lowercase': true, + 'space-tab-mixed-disabled': 'space', + 'tag-pair': true, + 'tag-self-close': true, + 'attr-no-duplication': true + }, + src: ['src/**/*.html'] + }, + + cacheBust: { + taskName: { + options: { + baseDir: '<%= yeoman.dist %>', + assets: ['scripts/**.js', 'styles/**.css'], + deleteOriginals: true + }, + src: ['<%= yeoman.dist %>/index.html'] + } + }, + 'goog-webfont-dl': { patuaOne: { options: { @@ -500,7 +523,8 @@ module.exports = function (grunt) { 'cssmin', 'uglify', 'usemin', - 'htmlmin' + 'htmlmin', + 'cacheBust' ]); grunt.registerTask('default', [ http://git-wip-us.apache.org/repos/asf/zeppelin/blob/13752e20/zeppelin-web/package.json ---------------------------------------------------------------------- diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json index ff18967..d8081ed 100644 --- a/zeppelin-web/package.json +++ b/zeppelin-web/package.json @@ -9,6 +9,7 @@ "autoprefixer": "^6.1.0", "bower": "1.7.2", "grunt": "^0.4.1", + "grunt-cache-bust": "^1.3.0", "grunt-cli": "^0.1.13", "grunt-concurrent": "^0.5.0", "grunt-contrib-clean": "^0.5.0",