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
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
480
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.5k
Greatest Disaster Hits in Web Performance
guaca
0
270
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
370
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
670
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
820
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
1
2.7k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
650
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
110
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.8k
Speed Design
sergeychernyshev
33
1.5k
4 Signs Your Business is Dying
shpigford
187
22k
The Curious Case for Waylosing
cassininazir
0
240
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
Evolving SEO for Evolving Search Engines
ryanjones
0
130
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
380
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
77
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!