Created
December 22, 2014 13:57
-
-
Save ecasilla/fbd87cc9751735a49857 to your computer and use it in GitHub Desktop.
append md5 to path for browser caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var calculateMD5String, filepath, md5; | |
| md5 = require('MD5'); | |
| calculateMD5String = function(path) { | |
| return '-' + md5(fs.readFileSync(path)); | |
| }; | |
| filepath = "app" + calculateMD5String("app.js") + ".js"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment