RAILS ASSET PIPELINEBY STEVE BUTTERWORTH
THE PROBLEM
OLD SKOOLCONFIG/ENVIRONMENTS/PRODUCTION.RBAPP/VIEWS/LAYOUTS/APPLICATION.HTML.HAMLRESULTS IN...
JUST AIN’T GOOD ENOUGHNO MINIMIFICATIONINACCURATE CACHE STAMPNO ORGANIZATION
NU SKOOLAPP/ASSETS IS YOUR NEW HOME FOR CSS AND JSEACH CONTROLLER HAS ITS OWN CSS AND JS FILEPRE-PROCESS JS WITH ERB OR CO...
PRO-PROCESSINGPRE-PROCESSOR DETERMINED BY FILE EXTENSIONCHAIN PRE-PROCESSORS
PRE-PROCESS CSS WITH SASSSCSS SYNTAX   GENERATED CSS
AS SIMPLE AS .... (ALMOST)YOU CAN USE THE SAME TAG HELPERS
MANIFESTSSPROCKETS MANIFEST APP/ASSETS/STYLESHEETS/APPLICATION.CSS WHEN ORDER MATTERS
DEBUGGING ASSETShttp://localhost.....http://localhost.....?debug_assets=true
CACHING- File includes MD5 hash of compiled content- 1 year max-age on cache-control headeraction_controller.perform_cachi...
COMPILE OFFLINE
SQUEEZE IT, SQUEEZE IT MORE  COMPRESS STYLESHEETS (SCSS IS ONLY OPTION)  COMPRESS JAVASCRIPT (UGLIFIER, YUI, CLOSURE)
RESOURCESHTTP://RAILSCASTS.COM/EPISODES/265-RAILS-3-1-OVERVIEWHTTP://WWW.YOUTUBE.COM/WATCH?V=CGDCI2HHFAUHTTP://GETSPROCKET...
Asset pipeline
Asset pipeline
Asset pipeline
Asset pipeline
Asset pipeline
Asset pipeline
Upcoming SlideShare
Loading in...5
×

Asset pipeline

2,722

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,722
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Asset pipeline"

    1. 1. RAILS ASSET PIPELINEBY STEVE BUTTERWORTH
    2. 2. THE PROBLEM
    3. 3. OLD SKOOLCONFIG/ENVIRONMENTS/PRODUCTION.RBAPP/VIEWS/LAYOUTS/APPLICATION.HTML.HAMLRESULTS IN...
    4. 4. JUST AIN’T GOOD ENOUGHNO MINIMIFICATIONINACCURATE CACHE STAMPNO ORGANIZATION
    5. 5. NU SKOOLAPP/ASSETS IS YOUR NEW HOME FOR CSS AND JSEACH CONTROLLER HAS ITS OWN CSS AND JS FILEPRE-PROCESS JS WITH ERB OR COFFEE-SCRIPTPRE-PROCESS CSS WITH SASS, LESS OR ERB
    6. 6. PRO-PROCESSINGPRE-PROCESSOR DETERMINED BY FILE EXTENSIONCHAIN PRE-PROCESSORS
    7. 7. PRE-PROCESS CSS WITH SASSSCSS SYNTAX GENERATED CSS
    8. 8. AS SIMPLE AS .... (ALMOST)YOU CAN USE THE SAME TAG HELPERS
    9. 9. MANIFESTSSPROCKETS MANIFEST APP/ASSETS/STYLESHEETS/APPLICATION.CSS WHEN ORDER MATTERS
    10. 10. DEBUGGING ASSETShttp://localhost.....http://localhost.....?debug_assets=true
    11. 11. CACHING- File includes MD5 hash of compiled content- 1 year max-age on cache-control headeraction_controller.perform_caching = true
    12. 12. COMPILE OFFLINE
    13. 13. SQUEEZE IT, SQUEEZE IT MORE COMPRESS STYLESHEETS (SCSS IS ONLY OPTION) COMPRESS JAVASCRIPT (UGLIFIER, YUI, CLOSURE)
    14. 14. RESOURCESHTTP://RAILSCASTS.COM/EPISODES/265-RAILS-3-1-OVERVIEWHTTP://WWW.YOUTUBE.COM/WATCH?V=CGDCI2HHFAUHTTP://GETSPROCKETS.ORG/HTTP://RYANBIGG.COM/GUIDES/ASSET_PIPELINE.HTML

    ×