Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Optimize Rails Asset Pipeline Deployment
Search
Cam Huynh
October 11, 2015
Technology
90
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
Transcript
21 slides
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!
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
72
FutureWorkz DevOps Workshop Day III - Gitlab Runner for CD
hqc
0
120
Futureworkz DevOps Workshop Day 1 - DevOps ToolChain
hqc
0
89
FutureWorkz DevOps Workshop Intro
hqc
1
74
Rack for beginners
hqc
0
86
Chat Implementation with RESTful (Ruby) and Web Socket
hqc
0
75
Monkey patching in Ruby
hqc
0
320
Other Decks in Technology
See All in Technology
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
280
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
5
610
認知負荷の減らし方 ~開発にも日常業務にも活かせるノウハウ~
minorun365
PRO
17
10k
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
270
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
150
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
240
Amazon EFS のマルウェアスキャンをClamAV で自前実装したら苦労した話
mtmtfactory01
0
120
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
140
お風呂場をサーバルームにしよう
yusuke427
0
400
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
140
Kiro Enterprise Management: 管理者が 1 か所で決め、全員の Kiro に届ける
inariku
PRO
0
110
メディアアートを〈拡張〉する——器官学と個体化論を手がかりに
_kotobuki_
0
260
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Design in an AI World
tapps
1
400
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
How to make the Groovebox
asonas
2
2.6k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Paper Plane
katiecoart
PRO
6
55k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
480
The Curious Case for Waylosing
cassininazir
1
630