-
What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?
-
What does it mean to precompile files? What does this have to do with coffeescript and sass files?
- Before we send a file to the browser, we have to precompile it to a language that the browser can handle (HTML, CSS & JS).
- If we are using a language that makes it easier to program in a certain language like Coffeescript, Sass or ERB, we have to first precompile it before serving it up to the browser.
-
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?
- They are not the same because the asset pipeline automatically joins all your CSS & JS assets into one file to cut down on the number of requests we make to the database.
-
What is a manifest (in terms of the asset pipeline)? Where can you find two manifests in Catch 'em All?
- It gives sprockets directives. They hold the instructions for which files to include in order to build the CSS & JS files for our application.
-
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?
- In a Rails project, we use the
stylesheet_link_tag
helper. You see this in theapplication.html.erb
file inapp/views/layouts
- In a Rails project, we use the
-
How is a digest/fingerprint used on the assets for caching purposes?
- Fingerprinting is a technique that makes the name of a file dependent on the contents of the file. Everytime we make a change to a asset file, the digest changes. The reason we do this is becuase if a client caches an asset, we need a way to tell the client that the asset has been updated and you should instead cache this newer version.
Last active
March 2, 2016 16:39
-
-
Save julsfelic/dc03218f50d6a5a62b73 to your computer and use it in GitHub Desktop.
Asset Pipeline Scavenger Hunt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment