SlideShare a Scribd company logo
1 of 20
RAILS ASSET PIPELINE
BY STEVE BUTTERWORTH
THE PROBLEM
OLD SKOOL
CONFIG/ENVIRONMENTS/PRODUCTION.RB




APP/VIEWS/LAYOUTS/APPLICATION.HTML.HAML




RESULTS IN...
JUST AIN’T GOOD ENOUGH

NO MINIMIFICATION

INACCURATE CACHE STAMP

NO ORGANIZATION
NU SKOOL

APP/ASSETS IS YOUR NEW HOME FOR CSS AND JS

EACH CONTROLLER HAS ITS OWN CSS AND JS FILE

PRE-PROCESS JS WITH ERB OR COFFEE-SCRIPT

PRE-PROCESS CSS WITH SASS, LESS OR ERB
PRO-PROCESSING

PRE-PROCESSOR DETERMINED BY FILE EXTENSION




CHAIN PRE-PROCESSORS
PRE-PROCESS CSS WITH SASS

SCSS SYNTAX   GENERATED CSS
AS SIMPLE AS .... (ALMOST)

YOU CAN USE THE SAME TAG HELPERS
MANIFESTS
SPROCKETS MANIFEST APP/ASSETS/STYLESHEETS/APPLICATION.CSS 




WHEN ORDER MATTERS
DEBUGGING ASSETS

http://localhost.....




http://localhost.....?debug_assets=true
CACHING

- File includes MD5 hash of compiled content
- 1 year max-age on cache-control header


action_controller.perform_caching = true
COMPILE OFFLINE
SQUEEZE IT, SQUEEZE IT MORE

  COMPRESS STYLESHEETS (SCSS IS ONLY OPTION)




  COMPRESS JAVASCRIPT (UGLIFIER, YUI, CLOSURE)
RESOURCES

HTTP://RAILSCASTS.COM/EPISODES/265-RAILS-3-1-OVERVIEW

HTTP://WWW.YOUTUBE.COM/WATCH?V=CGDCI2HHFAU

HTTP://GETSPROCKETS.ORG/

HTTP://RYANBIGG.COM/GUIDES/ASSET_PIPELINE.HTML

More Related Content

Viewers also liked

Top 8 maths teacher resume samples
Top 8 maths teacher resume samplesTop 8 maths teacher resume samples
Top 8 maths teacher resume samplesfernandotores132
 
eldorado reference letter
eldorado reference lettereldorado reference letter
eldorado reference letterBettina Dorrek
 
Permen PU 30 tahun 2006
Permen PU 30 tahun 2006Permen PU 30 tahun 2006
Permen PU 30 tahun 2006Fery Kurniadi
 
160216 Presentatie digitale dienstverlening 16 februari 2016
160216 Presentatie digitale dienstverlening 16 februari 2016160216 Presentatie digitale dienstverlening 16 februari 2016
160216 Presentatie digitale dienstverlening 16 februari 2016KING
 
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdam
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdamNetwerkbijeenkomst monitor 1 dec gemeente_rotterdam
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdamKING
 

Viewers also liked (16)

Top 8 maths teacher resume samples
Top 8 maths teacher resume samplesTop 8 maths teacher resume samples
Top 8 maths teacher resume samples
 
Pratica e cultura 9. Tv e bambini
Pratica e cultura 9. Tv e bambiniPratica e cultura 9. Tv e bambini
Pratica e cultura 9. Tv e bambini
 
Il web tra contenuti e usi sociali 2. I motori di ricerca e la google generation
Il web tra contenuti e usi sociali 2. I motori di ricerca e la google generationIl web tra contenuti e usi sociali 2. I motori di ricerca e la google generation
Il web tra contenuti e usi sociali 2. I motori di ricerca e la google generation
 
Bryan Dexter presents “Universal Waste Recycling.”
Bryan Dexter presents “Universal Waste Recycling.”Bryan Dexter presents “Universal Waste Recycling.”
Bryan Dexter presents “Universal Waste Recycling.”
 
Teoria e analisi del cinema 4. allen and his audience bailey the reluctant ...
Teoria e analisi del cinema 4. allen and his audience   bailey the reluctant ...Teoria e analisi del cinema 4. allen and his audience   bailey the reluctant ...
Teoria e analisi del cinema 4. allen and his audience bailey the reluctant ...
 
Utopie concrete
Utopie concreteUtopie concrete
Utopie concrete
 
CONTEÚDO
CONTEÚDOCONTEÚDO
CONTEÚDO
 
eldorado reference letter
eldorado reference lettereldorado reference letter
eldorado reference letter
 
2. I social network nella didattica
2. I social network nella didattica2. I social network nella didattica
2. I social network nella didattica
 
Extended essay intro
Extended essay introExtended essay intro
Extended essay intro
 
Komunikasi sosial
Komunikasi sosialKomunikasi sosial
Komunikasi sosial
 
Semiotica industrial design 5. La narrazione
Semiotica industrial design   5. La narrazioneSemiotica industrial design   5. La narrazione
Semiotica industrial design 5. La narrazione
 
02. pkp sosnas nsup - Kota Tanpa Kumuh - KOTAKU
02. pkp sosnas nsup - Kota Tanpa Kumuh - KOTAKU02. pkp sosnas nsup - Kota Tanpa Kumuh - KOTAKU
02. pkp sosnas nsup - Kota Tanpa Kumuh - KOTAKU
 
Permen PU 30 tahun 2006
Permen PU 30 tahun 2006Permen PU 30 tahun 2006
Permen PU 30 tahun 2006
 
160216 Presentatie digitale dienstverlening 16 februari 2016
160216 Presentatie digitale dienstverlening 16 februari 2016160216 Presentatie digitale dienstverlening 16 februari 2016
160216 Presentatie digitale dienstverlening 16 februari 2016
 
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdam
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdamNetwerkbijeenkomst monitor 1 dec gemeente_rotterdam
Netwerkbijeenkomst monitor 1 dec gemeente_rotterdam
 

Similar to Asset pipeline

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best PracticesHolger Bartel
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStefan Bauer
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}Eric Carlisle
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsEdgar Silva
 
The World of Stylesheet Languages
The World of Stylesheet LanguagesThe World of Stylesheet Languages
The World of Stylesheet LanguagesAndrea Tino
 
CCSP 2012F 早點下班的工具
CCSP 2012F 早點下班的工具 CCSP 2012F 早點下班的工具
CCSP 2012F 早點下班的工具 裕欽 林
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionIrfan Maulana
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozókMáté Farkas
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassMediacurrent
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end developmentMatthew Carleton
 

Similar to Asset pipeline (20)

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
Less vs sass
Less vs sassLess vs sass
Less vs sass
 
Brunch With Coffee
Brunch With CoffeeBrunch With Coffee
Brunch With Coffee
 
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
 
Big Frontends Made Simple
Big Frontends Made SimpleBig Frontends Made Simple
Big Frontends Made Simple
 
The World of Stylesheet Languages
The World of Stylesheet LanguagesThe World of Stylesheet Languages
The World of Stylesheet Languages
 
LESS vs. SASS
LESS vs. SASSLESS vs. SASS
LESS vs. SASS
 
CCSP 2012F 早點下班的工具
CCSP 2012F 早點下班的工具 CCSP 2012F 早點下班的工具
CCSP 2012F 早點下班的工具
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS Introduction
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozók
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs Sass
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n