AdamP
AdamP

Reputation: 207

Serving image assets from S3 with ember-cli-deploy Lightning method

I'm trying to deploy an Ember CLI app using ember-cli-deploy and the 'lightning' deployment method (http://ember-cli-deploy.com/docs/v0.6.x/the-lightning-strategy/).

I've got a redis server to serve my index.html file. I've got my assets uploaded to S3. However my image assets don't seem to be loading properly.

In ember-cli-build.js I have:

var app = new EmberApp(defaults, {
  fingerprint: {
    prepend: '//path-to-my-S3-bucket/'
  }
});

but for some reason images are still being served from the redis server IP. I am getting errors like "Failed to load http://redis-server-url/my-image.jpg". Javascript and CSS files are working fine from S3.

Have I missed something here? Is there another step to this configuration?

Many thanks

Upvotes: 1

Views: 174

Answers (1)

Jack Rowlingson
Jack Rowlingson

Reputation: 325

I would confirm that fingerprinting is enabled. It is only enabled for 'production' builds by default. You should see an md5 checksum appended to your asset file names. For example, my-image.jpg should be something like my-image-9c2cbd818d09a4a742406c6cb8219b3b.jpg

You can override the default behavior by passing the enabled option:

var app = new EmberApp(defaults, {
  fingerprint: {
    enabled: true,
    prepend: '//path-to-my-S3-bucket/'
  }
});

Upvotes: 2

Related Questions