デフォルトのままだとタイムスタンプが使われるので、複数人でコンパイル済みCSSをバージョン管理している場合に余計な差分が発生してしまう。
config.rbに以下を追加。
config.rb
asset_cache_buster do |path, file|
if File.file?(file.path)
Digest::MD5.hexdigest(File.read(file.path))[0, 8]
else
$stderr.puts "WARNING: '#{File.basename(path)}' was not found (or cannot be read) in #{File.dirname(file.path)}"
end
end
hoge.scss
p {
background: image_url('hoge.png') no-repeat;
}
hoge.css
/* before */
p {
background: url('/images/hoge.png?1369971442') no-repeat;
}
/* after */
p {
background: url('/images/hoge.png?b68b9eca') no-repeat;
}