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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Cam Huynh
October 11, 2015
Technology
83
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
130
FutureWorkz DevOps Workshop Day II - Deploying Rails
hqc
0
68
FutureWorkz DevOps Workshop Day III - Gitlab Runner for CD
hqc
0
110
Futureworkz DevOps Workshop Day 1 - DevOps ToolChain
hqc
0
81
FutureWorkz DevOps Workshop Intro
hqc
1
70
Rack for beginners
hqc
0
81
Chat Implementation with RESTful (Ruby) and Web Socket
hqc
0
72
Monkey patching in Ruby
hqc
0
310
Other Decks in Technology
See All in Technology
少人数データチームのDevin活用実践事例
runandy16
2
450
AndroidでHDRメディアを「壊さずに」扱う
chigichan24
0
410
20260903 Tokyo Jazug Night #62 | Azure エンジニアよ、 その環境は本当にセキュアか?
olivia_0707
1
620
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
0
440
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
260
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
1k
Genie Code ワークショップ 基礎編 / Genie-Code-Workshop-fundamental
databricksjapan
PRO
0
360
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
360
AI時代におけるプロダクト横断勉強会の設計
zozotech
PRO
0
160
Hub & Spoke 環境のネットワークルーティングを分解してみる
tsuyataku
1
530
bet_ai_day_2026_session02
agenticsec
1
1.2k
When Does a Local Qwen Start to Break
morshoto
0
180
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Product Roadmaps are Hard
iamctodd
55
13k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
970
First, design no harm
axbom
PRO
2
1.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Raft: Consensus for Rubyists
vanstee
141
7.7k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
450
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
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!