2
我見過使用urlArgs來強制文件更改的許多解決方案,但是有沒有一種有效的方法來讓文件自動更改只有單個文件?RequireJS自動單個文件緩存胸圍
是否有可能僅對已修改的文件進行緩存?
The biggest example being this topic.
function bust(path) {
return path + '?bust=' + (new Date()).getTime();
}
require.config({
baseUrl: '/base/path',
paths: {
'fileAlias': bust('fileLikelyToChange'),
'anotherFileAlias': bust('anotherFileLikelyToChange'),
'jQuery': 'jQuery'
},
});
問題是這樣的解決方案,每次蕭條的緩存,而不是隻有當文件已被修改。
怎麼能RequireJS知道文件是否被修改? – idbehold 2014-09-05 19:24:52
你的問題是我的答案。 RequireJS似乎沒有可行的方法。試圖尋找可能沒有的解決方案。 :/ – nicholinde 2014-09-05 19:33:45