Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Optimize Rails Asset Pipeline Deployment
Search
Cam Huynh
October 11, 2015
Technology
0
74
Optimize Rails Asset Pipeline Deployment
Cam Huynh
October 11, 2015
Tweet
Share
More Decks by Cam Huynh
See All by Cam Huynh
Reddit Ruby Conf 2016 Recap
hqc
0
120
FutureWorkz DevOps Workshop Day II - Deploying Rails
hqc
0
53
FutureWorkz DevOps Workshop Day III - Gitlab Runner for CD
hqc
0
99
Futureworkz DevOps Workshop Day 1 - DevOps ToolChain
hqc
0
75
FutureWorkz DevOps Workshop Intro
hqc
1
64
Rack for beginners
hqc
0
75
Chat Implementation with RESTful (Ruby) and Web Socket
hqc
0
64
Monkey patching in Ruby
hqc
0
300
Other Decks in Technology
See All in Technology
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
Agent Skils
dip_tech
PRO
0
120
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
4
1.3k
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
120
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
350
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
100
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
コミュニティが変えるキャリアの地平線:コロナ禍新卒入社のエンジニアがAWSコミュニティで見つけた成長の羅針盤
kentosuzuki
0
120
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
650
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
310
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
67
Into the Great Unknown - MozCon
thekraken
40
2.3k
The Pragmatic Product Professional
lauravandoore
37
7.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
New Earth Scene 8
popppiees
1
1.5k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
A designer walks into a library…
pauljervisheath
210
24k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
200
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Optimizing for Happiness
mojombo
379
71k
Transcript
ASSET PIPELINE OPTIMIZATION by @huynhquancam
WHAT SHOULD YOU KNOW ABOUT THIS GUY? My name is
Huynh Quan Cam. Responsible for the development and engineering of Dadadee.
WHAT’S THE TALK ABOUT? Rails Assets pipeline. Deploy assets pipeline
on multiple servers. How to optimize the deployment?
ASSETS PIPELINE concatenate and minify or compress JavaScript and CSS
assets. support pre-processors such as CoffeeScript, Sass and ERB. based on Sprockets.
USING ASSET PIPELINE
– 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
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.
CAPISTRANO-RAILS capistrano-rails is a set of Capistrano tasks to automate
Rails deployment. migrations. assets pre-compilation.
ORCHESTRATION SCRIPT
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.
Can we only pre-compile once?
ASSET FINGERPRINTS generated based on file content. optimize client-side caching.
better cache invalidation.
ASSET FINGERPRINT application.css application-908e25f4bf641868d8683022a5b62f54.css application.css application-723d1be6cc741a3aabb1cec24276d681.css
ASSET MANIFEST a manifest-<md5-hash>.json cache every fingerprint of your Rails
static assets. accelerate Rails helper call.
ASSET MANIFEST
NOTES fingerprints only change if file contents change. fingerprints don’t
change across servers. all fingerprint requests are handled by manifest file.
Pre-compile once and sync the manifest file to others.
IMPLEMENTATION
IMPLEMENTATION
QUESTIONS?
THANK YOU!