aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helper.rb
diff options
context:
space:
mode:
authorEvan Petrie <epetrie@shoedazzle.com>2011-04-14 12:08:18 -0700
committerEvan Petrie <epetrie@shoedazzle.com>2011-04-14 12:08:18 -0700
commit53d3bafc8bf3f0cb90a02751aa93b0c30b26ab78 (patch)
treec3a0e3f27319f870c8336c41e994b8c25a3e6174 /actionpack/lib/action_view/helpers/asset_tag_helper.rb
parent6b6ecbefad648f39b507dbb59c9d22ff9031f7a8 (diff)
downloadrails-53d3bafc8bf3f0cb90a02751aa93b0c30b26ab78.tar.gz
rails-53d3bafc8bf3f0cb90a02751aa93b0c30b26ab78.tar.bz2
rails-53d3bafc8bf3f0cb90a02751aa93b0c30b26ab78.zip
ruby 1.9.2 and other ruby implementations may not return the same hash value for the same string each time. This can result in your static assets being served from different asset hosts, which makes browser caching less effective. Use md5 or some other digest method instead.
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index f6b2d4f3f4..c383e4990c 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -57,7 +57,7 @@ module ActionView
# +asset_host+ to a proc like this:
#
# ActionController::Base.asset_host = Proc.new { |source|
- # "http://assets#{source.hash % 2 + 1}.example.com"
+ # "http://assets#{Digest::MD5.hexdigest(source).to_i(16) % 2 + 1}.example.com"
# }
# image_tag("rails.png")
# # => <img alt="Rails" src="http://assets1.example.com/images/rails.png?1230601161" />