Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Optimize Rails Asset Pipeline Deployment

Cam Huynh
October 11, 2015

Optimize Rails Asset Pipeline Deployment

Cam Huynh

October 11, 2015
Tweet

More Decks by Cam Huynh

Other Decks in Technology

Transcript

  1. WHAT SHOULD YOU KNOW ABOUT THIS GUY? My name is

    Huynh Quan Cam. Responsible for the development and engineering of Dadadee.
  2. WHAT’S THE TALK ABOUT? Rails Assets pipeline. Deploy assets pipeline

    on multiple servers. How to optimize the deployment?
  3. ASSETS PIPELINE concatenate and minify or compress JavaScript and CSS

    assets. support pre-processors such as CoffeeScript, Sass and ERB. based on Sprockets.
  4. – The Rails core team. “TIPS OF THE DAY” You

    can get rid of sprockets by executing this command at the start. rails new my-awesome-app-without-sprockets --skip-sprockets
  5. SITUATION we are deploying an Rails app to four servers:

    2 web, 1 database and 1 worker. db and worker servers need static assets to work. zero-down time deployment and rollback required.
  6. CAPISTRANO-RAILS capistrano-rails is a set of Capistrano tasks to automate

    Rails deployment. migrations. assets pre-compilation.
  7. WHAT’S WRONG WITH THIS APPROACH? waste of time. waste of

    computing resources. waste of storage resources, especially when you’re using CDNs like CloudFront.
  8. NOTES fingerprints only change if file contents change. fingerprints don’t

    change across servers. all fingerprint requests are handled by manifest file.