Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save notmarkmiranda/1927d8b16c15c3fc63df9a03fce28ad3 to your computer and use it in GitHub Desktop.
Save notmarkmiranda/1927d8b16c15c3fc63df9a03fce28ad3 to your computer and use it in GitHub Desktop.
20160420 - Asset Pipeline Challenge

What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

  • appending one file to another file

What does it mean to precompile files? What does this have to do with coffeescript and sass files?

  • turns sass in css, coffeescript into js, erb into html before needing them to save time/bandwidth

What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?

Start up the server for Catch 'em All (rails s) and navigate to http://localhost:3000/assets/application.js. Then open up the code for application.js in your text editor. Why are these not the same?

  • I'm not sure, but I think it has something to do with pre-compiling?

What is a manifest (in terms of the asset pipeline)? Where can you find two manifests in Catch 'em All?

  • A manifest is what the asset pipeline uses in order to determine what to include vs serve
  • application.js & application.css

In regular HTML files, we bring in css files with . How is this done in a Rails project? Where do you see this line in Catch 'em All?

  • <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  • in application.html.erb

How is a digest/fingerprint used on the assets for caching purposes?

  • It is a way to determine if a file has changed. Filename is dependent on file contents, creates a fingerprint. if the fingerprint is changed, the file is reserved to the client
@Carmer
Copy link

Carmer commented Apr 20, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment