Set cache-control & expires headers to the content served by S3 using attachment_fu or paperclip

Published on

Using attachment_fu with S3 to save and serve data? Set cache-control headers by applying this patch to improve site performance and save some money: http://www.gozuus.com/blog/2009/03/caching-images-using-attachment_fu-and-amazon-s3/ If using PaperClip then add headers by adding: Find more info about paperclip s3 options here: http://rubydoc.info/gems/paperclip/Paperclip/Storage/S3

Edge Rails: Array#random_element

Published on

Array#rand is deprecated in favor of Array#random_element and will be removed in Rails 3. As per the comment added to the commit: Array#rand is deprecated because it masks Kernel#rand within the Array class itself, which may be used by a 3rd party library extending Array in turn. See https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4555