1

我需要在我的 Ember-CLI 应用程序中有动态更改路径的图像,即 <img src="my_dynamic_path">.

但是,因为 Ember 向所有图像添加了缓存清除字符串,所以我不能这样做。

有什么方法可以禁用 cachebusting 字符串,或者某些函数可以找到 cachebusted 图像名称的 URL,或者不受此行为影响的文件夹?

4

1 回答 1

5

您可以做一些事情,ember-cli 使用broccoli-asset-rev对文件进行指纹识别。

您可以禁用指纹识别:

var app = new EmberApp({
  fingerprint: {
    enabled: false
  }
});

您可以选择排除某些目录/文件:

var app = new EmberApp({
  fingerprint: {
    exclude: ['my/ignored/directory']
  }
});

有关指纹的更多信息,请查看文档中的资产编译

于 2015-08-05T06:12:52.580 回答