$30 off During Our Annual Pro Sale. View Details »
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
73
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
52
FutureWorkz DevOps Workshop Day III - Gitlab Runner for CD
hqc
0
97
Futureworkz DevOps Workshop Day 1 - DevOps ToolChain
hqc
0
73
FutureWorkz DevOps Workshop Intro
hqc
1
63
Rack for beginners
hqc
0
73
Chat Implementation with RESTful (Ruby) and Web Socket
hqc
0
63
Monkey patching in Ruby
hqc
0
300
Other Decks in Technology
See All in Technology
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
170
LLM-Readyなデータ基盤を高速に構築するためのアジャイルデータモデリングの実例
kashira
0
240
AWSセキュリティアップデートとAWSを育てる話
cmusudakeisuke
0
240
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
280
AI活用によるPRレビュー改善の歩み ― 社内全体に広がる学びと実践
lycorptech_jp
PRO
1
200
直接メモリアクセス
koba789
0
290
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
340
re:Inventで気になったサービスを10分でいけるところまでお話しします
yama3133
1
120
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
3k
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
350
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
120
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
1
710
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Designing Experiences People Love
moore
143
24k
The Invisible Side of Design
smashingmag
302
51k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
Writing Fast Ruby
sferik
630
62k
Statistics for Hackers
jakevdp
799
230k
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!