Repository: zeppelin Updated Branches: refs/heads/master 2696930ed -> 848dbd030
[Zeppelin-1229] Add cache buster for zeppelin-web build ### What is this PR for? 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. ### What type of PR is it? Improvement ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-1229 ### How should this be tested? * 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. ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Damien CORNEAU <[email protected]> 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 Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/848dbd03 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/848dbd03 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/848dbd03 Branch: refs/heads/master Commit: 848dbd0302a4e6d4917a70c1cbc2220a7a814488 Parents: 2696930 Author: Damien CORNEAU <[email protected]> Authored: Mon Jul 25 14:20:06 2016 +0900 Committer: Damien CORNEAU <[email protected]> Committed: Fri Jul 29 15:41:49 2016 +0900 ---------------------------------------------------------------------- zeppelin-web/Gruntfile.js | 14 +++++++++++++- zeppelin-web/package.json | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/848dbd03/zeppelin-web/Gruntfile.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js index 63abc33..34f7304 100644 --- a/zeppelin-web/Gruntfile.js +++ b/zeppelin-web/Gruntfile.js @@ -68,6 +68,17 @@ module.exports = function(grunt) { 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: { @@ -534,7 +545,8 @@ module.exports = function(grunt) { 'cssmin', 'uglify', 'usemin', - 'htmlmin' + 'htmlmin', + 'cacheBust' ]); grunt.registerTask('default', [ http://git-wip-us.apache.org/repos/asf/zeppelin/blob/848dbd03/zeppelin-web/package.json ---------------------------------------------------------------------- diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json index a8e035a..2ff74e6 100644 --- a/zeppelin-web/package.json +++ b/zeppelin-web/package.json @@ -10,6 +10,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",
