From 19a1aee90f073341b116324f6f9ea0eb6fdbf085 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 2 Feb 2009 12:15:37 -0700 Subject: [PATCH] use the s3_options hash to pass in cache and expires headers --- app/models/page_attachment.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/page_attachment.rb b/app/models/page_attachment.rb index 0d4c471..9c2eb47 100644 --- a/app/models/page_attachment.rb +++ b/app/models/page_attachment.rb @@ -1,6 +1,10 @@ class PageAttachment < ActiveRecord::Base acts_as_list :scope => :page_id - has_attachment :storage => :s3, + has_attachment :storage => :s3, + :s3_options => { + :cache_control => 'max-age=315360000', + :expires => 'Thu, 31 Dec 2037 23:55:55 GMT' + } :thumbnails => defined?(PAGE_ATTACHMENT_SIZES) && PAGE_ATTACHMENT_SIZES || {:icon => '144x144>'}, :max_size => 10.megabytes validates_as_attachment