Created
June 11, 2019 19:43
-
-
Save Andy-set-studio/2d718383090cf4c04edfb4e44906288d to your computer and use it in GitHub Desktop.
Cache busting with 11ty (stick global.js in _data folder)
This file contains 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
module.exports = { | |
random() { | |
const segment = () => { | |
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | |
}; | |
return `${segment()}-${segment()}-${segment()}`; | |
} | |
}; |
This file contains 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
<link rel="stylesheet" href="/css/main.js?v={{ global.random() }}" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment