Skip to content

Commit

Permalink
[asset pipeline] Add resources to fingerprinting
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Hulse committed Jul 3, 2011
1 parent cfbed13 commit 0dc2c57
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions railties/guides/source/asset_pipeline.textile
Expand Up @@ -46,16 +46,15 @@ Fingerprinting is a technique where the filenames of content that is static or i

When a filename is unique and based on its content, http headers can be set to encourage caches everywhere (at ISPs, in browsers) to keep there own copy of the content. When the content is updated, the fingerprint will change and the remote clients will request the new file. This is generally known as _cachebusting_.

The most common technique is to insert a hash of the content into the name, usually at the end. For example a CSS file +global.css+ is hashed and the filename is updated to incorporate the hash.

The most effective technique is to insert a hash of the content into the name, usually at the end. For example a CSS file +global.css+ is hashed and the filename is updated to incorporate the hash.

<plain>
global.css => global-908e25f4bf641868d8683022a5b62f54.css
</plain>

This is the strategy adopted by the Rails asset pipeline.

Rails old strategy was to append a query string to every asset linked with a built-in helper. In the source the generated code looks like this:
Rails old strategy was to append a query string to every asset linked with a built-in helper. In the source the generated code looked like this:

<plain>
/stylesheets/global.css?1309495796
Expand Down

0 comments on commit 0dc2c57

Please sign in to comment.