Skip to content

Instantly share code, notes, and snippets.

@GregoryArmstrong
Last active January 13, 2016 19:58
Show Gist options
  • Save GregoryArmstrong/0b0e3ff56b09105c58b4 to your computer and use it in GitHub Desktop.
Save GregoryArmstrong/0b0e3ff56b09105c58b4 to your computer and use it in GitHub Desktop.

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

  • To put them together so theyre treated as one. We might want to concatenate to send fewer files for the same amount of data.

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

  • Coffeescript and Sass files are precompiled into their base language so that translation is not needed on the client side.

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

  • To remove unneccesary things such as whitespace from files so that they're as small as they can be.

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?

  • The file on the server contains all JS used by the server, whereas the application.js in your editor is usually fairly visually empty as it is used to add custom JS to the other required JS files for the app.

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

  • A file containing meta-data for accompanying files. The application.js on the server would be one of these, the other would be 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?

  • This is handled by the application.html.erb file in Rails.

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

  • The assets filename/contents are fingerprinted together, so that if the file is changed the fingerprint changes and the remote users know to re-download the new content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment