 <p>Arjan van der Gaag made a gem specifically for this: <a href="https://github.com/avdgaag/nanoc-cachebuster" rel="nofollow">https://github.com/avdgaag/nanoc-cachebuster</a></p> <p><a href="http://arjanvandergaag.nl/blog/nanoc-cachebuster.html" rel="nofollow">To quote the man himself</a>:</p> <blockquote> <p>Usage is simple, as you only need to install the gem:</p> <pre><code>$ gem install nanoc-cachebuster </code></pre> <p>and require the gem and include the helpers to get going:</p> <pre><code># in default.rb require 'nanoc3/cachebuster' include Nanoc3::Helpers::CacheBusting </code></pre> <p>You can now use the #fingerprint method in your routing rules:</p> <pre><code>route '/assets/styles/' do item.identifier.chop + fingerprint(item) + '.' + item[:identifier] end </code></pre> <p>The gem will make sure that references to files you have fingerprinted will get updated when you compile your site.</p> </blockquote>