From 8ffaa39b75982cd59f1ab843be0502143e0627e0 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Sun, 14 Apr 2013 13:38:23 +0530 Subject: Added description for mtime --- guides/source/asset_pipeline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 43df544e28..1e33af2658 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -75,7 +75,7 @@ The query string strategy has several disadvantages: 2. **The file name can change between nodes in multi-server environments.**
The default query string in Rails 2.x is based on the modification time of the files. When assets are deployed to a cluster, there is no guarantee that the timestamps will be the same, resulting in different values being used depending on which server handles the request. 3. **Too much cache invalidation**
- When static assets are deployed with each new release of code, the mtime of _all_ these files changes, forcing all remote clients to fetch them again, even when the content of those assets has not changed. + When static assets are deployed with each new release of code, the mtime(time of last modification) of _all_ these files changes, forcing all remote clients to fetch them again, even when the content of those assets has not changed. Fingerprinting fixes these problems by avoiding query strings, and by ensuring that filenames are consistent based on their content. -- cgit v1.2.3 From 1655f4142efa89acb86812f5c1d7572e51cbae80 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 15 Apr 2013 14:46:11 +0200 Subject: more Ruby 1.9 Hash syntax in our guides --- guides/source/asset_pipeline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 1e33af2658..54548c5a0b 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -707,7 +707,7 @@ config.assets.cache_store = :memory_store The options accepted by the assets cache store are the same as the application's cache store. ```ruby -config.assets.cache_store = :memory_store, { :size => 32.megabytes } +config.assets.cache_store = :memory_store, { size: 32.megabytes } ``` Adding Assets to Your Gems -- cgit v1.2.3 From bdce0c0bb10da18de955a9af5cb2bcadbc255f7b Mon Sep 17 00:00:00 2001 From: Zoltan Debre Date: Tue, 23 Apr 2013 14:10:18 +0200 Subject: Update assets_pipeline with config.assets.precompile location rake assets:precompile will work if config.assets.precompile is in config/application.rb and not in config/environment/production.rb --- guides/source/asset_pipeline.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 54548c5a0b..85301f69bc 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -450,7 +450,7 @@ The default matcher for compiling files includes `application.js`, `application. NOTE. The matcher (and other members of the precompile array; see below) is applied to final compiled file names. This means that anything that compiles to JS/CSS is excluded, as well as raw JS/CSS files; for example, `.coffee` and `.scss` files are **not** automatically included as they compile to JS/CSS. -If you have other manifests or individual stylesheets and JavaScript files to include, you can add them to the `precompile` array: +If you have other manifests or individual stylesheets and JavaScript files to include, you can add them to the `precompile` array in `config/application.rb`: ```ruby config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js'] @@ -459,7 +459,7 @@ config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js'] Or you can opt to precompile all assets with something like this: ```ruby -# config/environments/production.rb +# config/application.rb config.assets.precompile << Proc.new do |path| if path =~ /\.(css|js)\z/ full_path = Rails.application.assets.resolve(path).to_path -- cgit v1.2.3