禁用缓存清除字符串 Ember-CLI 生产构建
Disable cachebusting string Ember-CLI production build
我的 Ember-CLI 应用程序中需要动态更改路径的图像,即 <img src="my_dynamic_path">
.
但是,因为 Ember 向所有图像添加了缓存无效化字符串,所以我无法执行此操作。
有没有什么方法可以禁用缓存清除字符串,或者某些函数可以找到 URL 缓存清除图像名称,或者一个不受此行为影响的文件夹?
您可以做一些事情,ember-cli 使用 broccoli-asset-rev 对文件进行指纹识别。
您可以禁用指纹:
var app = new EmberApp({
fingerprint: {
enabled: false
}
});
您可以选择排除某些directories/files:
var app = new EmberApp({
fingerprint: {
exclude: ['my/ignored/directory']
}
});
有关指纹识别的更多信息,请查看 asset compilation in the docs。
我的 Ember-CLI 应用程序中需要动态更改路径的图像,即 <img src="my_dynamic_path">
.
但是,因为 Ember 向所有图像添加了缓存无效化字符串,所以我无法执行此操作。
有没有什么方法可以禁用缓存清除字符串,或者某些函数可以找到 URL 缓存清除图像名称,或者一个不受此行为影响的文件夹?
您可以做一些事情,ember-cli 使用 broccoli-asset-rev 对文件进行指纹识别。
您可以禁用指纹:
var app = new EmberApp({
fingerprint: {
enabled: false
}
});
您可以选择排除某些directories/files:
var app = new EmberApp({
fingerprint: {
exclude: ['my/ignored/directory']
}
});
有关指纹识别的更多信息,请查看 asset compilation in the docs。