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
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
配列に見る bash と zsh の違い
kazzpapa3
3
160
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
240
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
380
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
1
2.7k
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
240
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
160
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
350
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.6k
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
370
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
1
160
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
Code Review Best Practice
trishagee
74
20k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
150
Believing is Seeing
oripsolob
1
56
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
320
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
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!