Assets
- We use Rails' asset pipeline.
- Assets are compiled and pushed to dedicated bucket(ENV['OMA_ASSET_BUCKET']) on S3 and are served from amazon's Cloudfront service.
- 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.
- All asset paths must use rails asset helpers so proper urls are generated. Otherwise you can't expect the asset to work.
- Each asset will be served by the Heroku app only once.
- 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.