Assets

  1. We use Rails' asset pipeline.

  2. Assets are compiled and pushed to dedicated bucket(ENV['OMA_ASSET_BUCKET']) on S3 and are served from amazon's Cloudfront service.

  3. Asset urls point to cloudfront ENV['OMA_ASSET_HOST']. The first time the asset is accessed it does not yet exist on cloudfront. Cloudfront gets it from S3 and if doesn't find it asks the rails app for it.

  4. All asset paths must use rails asset helpers so proper urls are generated. Otherwise you can't expect the asset to work.

  5. Each asset will be served by the Heroku app only once.

  6. An asset never expires since it is fingerprinted. And headers returned when the asset is served should set it's expiration date to 1+ years.

Last updated