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
76
0
Share
Optimize Rails Asset Pipeline Deployment
Cam Huynh
October 11, 2015
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
64
FutureWorkz DevOps Workshop Day III - Gitlab Runner for CD
hqc
0
100
Futureworkz DevOps Workshop Day 1 - DevOps ToolChain
hqc
0
77
FutureWorkz DevOps Workshop Intro
hqc
1
65
Rack for beginners
hqc
0
76
Chat Implementation with RESTful (Ruby) and Web Socket
hqc
0
67
Monkey patching in Ruby
hqc
0
310
Other Decks in Technology
See All in Technology
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
2.1k
JJUG CCC 2026 Spring AI時代の開発こそ標準化を武器に! ― 方式・プロセス・プラットフォームの標準化
s27watanabe
2
690
運用を見据えたAIエージェント設計実践
amacbee
1
2.4k
Sony_KMP_Journey_KotlinConf2026
sony
2
210
TROCCOで始めるクラウドコストを民主化するためのFinOps
tk3fftk
3
560
先取りMaven4 ~16年ぶりのメジャーアップデート、その進化とは?~
ogiwarat
0
140
AIプラットフォームを運用し続けるための可観測性
tanimuyk
4
1.1k
新規事業を牽引する技術選定 〜フルスタックTypeScript開発の実践事例〜
nullnull
2
260
生成 AI × MCP で切り拓く次世代 SRE!自律型運用への挑戦と開発者体験の進化
_awache
0
110
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
450
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
700
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
180
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Everyday Curiosity
cassininazir
0
220
Designing for Timeless Needs
cassininazir
1
250
The World Runs on Bad Software
bkeepers
PRO
72
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
680
Unsuck your backbone
ammeep
672
58k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Mind Mapping
helmedeiros
PRO
1
230
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
560
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
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!