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
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
200
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.2k
Agile Leadership Summit Keynote 2026
m_seki
1
640
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.8k
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
Agent Skils
dip_tech
PRO
0
120
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
20260204_Midosuji_Tech
takuyay0ne
1
160
Context Engineeringの取り組み
nutslove
0
360
プロポーザルに込める段取り八分
shoheimitani
1
450
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8k
Designing Experiences People Love
moore
144
24k
Making Projects Easy
brettharned
120
6.6k
How STYLIGHT went responsive
nonsquared
100
6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
55
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
30 Presentation Tips
portentint
PRO
1
220
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Automating Front-end Workflow
addyosmani
1371
200k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
Building AI with AI
inesmontani
PRO
1
700
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!