diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2016-05-30 14:53:03 +0300 |
---|---|---|
committer | Genadi Samokovarov <gsamokovarov@gmail.com> | 2016-05-30 14:53:03 +0300 |
commit | a11a3861b474ef642ac48796572d6276436c7eb0 (patch) | |
tree | 5e7da0567079981991e9a23696c7d20faf4c9f2b /guides/source/asset_pipeline.md | |
parent | e6ed3aaf437887bc25a1f715f21c5ca3ebbc966f (diff) | |
parent | 3f2e83d964fcb4cd7f7f2ed8fb2b2592ffc57647 (diff) | |
download | rails-a11a3861b474ef642ac48796572d6276436c7eb0.tar.gz rails-a11a3861b474ef642ac48796572d6276436c7eb0.tar.bz2 rails-a11a3861b474ef642ac48796572d6276436c7eb0.zip |
Merge branch 'master' into always-inherit-from-application-record
Diffstat (limited to 'guides/source/asset_pipeline.md')
-rw-r--r-- | guides/source/asset_pipeline.md | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index cc3da47db9..e6631a513c 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -435,11 +435,11 @@ Sprockets uses manifest files to determine which assets to include and serve. These manifest files contain _directives_ - instructions that tell Sprockets which files to require in order to build a single CSS or JavaScript file. With these directives, Sprockets loads the files specified, processes them if -necessary, concatenates them into one single file and then compresses them (if -`Rails.application.config.assets.compress` is true). By serving one file rather -than many, the load time of pages can be greatly reduced because the browser -makes fewer requests. Compression also reduces file size, enabling the -browser to download them faster. +necessary, concatenates them into one single file and then compresses them +(based on value of `Rails.application.config.assets.js_compressor`). By serving +one file rather than many, the load time of pages can be greatly reduced because +the browser makes fewer requests. Compression also reduces file size, enabling +the browser to download them faster. For example, a new Rails application includes a default @@ -1105,11 +1105,17 @@ NOTE: You will need an [ExecJS](https://github.com/rails/execjs#readme) supported runtime in order to use `uglifier`. If you are using Mac OS X or Windows you have a JavaScript runtime installed in your operating system. -NOTE: The `config.assets.compress` initialization option is no longer used in -Rails to enable either CSS or JavaScript compression. Setting it will have no -effect on the application. Instead, setting `config.assets.css_compressor` and -`config.assets.js_compressor` will control compression of CSS and JavaScript -assets. + + +### Serving GZipped version of assets + +By default, gzipped version of compiled assets will be generated, along +with the non-gzipped version of assets. Gzipped assets help reduce the transmission of +data over the wire. You can configure this by setting the `gzip` flag. + +```ruby +config.assets.gzip = false # disable gzipped assets generation +``` ### Using Your Own Compressor @@ -1280,7 +1286,7 @@ config.assets.js_compressor = :uglifier # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = false -# Generate digests for assets URLs. This is planned for deprecation. +# Generate digests for assets URLs. config.assets.digest = true # Precompile additional assets (application.js, application.css, and all |