Search code examples
ember-clibroccolijs

Disable cachebusting string Ember-CLI production build


I need to have images in my Ember-CLI application for which I change the path dynamically, i.e. <img src="my_dynamic_path">.

However, because Ember adds a cachebusting string to all the images, I can't do this.

Is there any way to disable the cachebusting string, or some function that finds a URL of a cachebusted image-name, or a folder which is unaffected by this behavior?


Solution

  • There are a few things that you can do, ember-cli uses broccoli-asset-rev to fingerprint files.

    You can either disable fingerprinting:

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

    You can choose to exclude certain directories/files:

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

    For more information regarding fingerprinting check out asset compilation in the docs.