Add expire header for images stored in amazon s3

22 views
Skip to first unread message

Maddy

unread,
Dec 17, 2012, 4:07:07 AM12/17/12
to rubyonra...@googlegroups.com
Hi everyone Good Afternoon,

  I done adding expire header by put the following code into my product
model.

    :s3_headers => { 'Cache-Control' => 'max-age=315576000', 'Expires' 
=>
10.years.from_now.httpdate },

  But its work only while i add new product and image.
  Already i have 100 of products and images. How can i add expire header
for those which already exist products.

Please advice.

Frederick Cheung

unread,
Dec 17, 2012, 7:40:01 AM12/17/12
to rubyonra...@googlegroups.com
You'll have to iterate over all the files in question and set their expires for them. If you use the copy operation to copy a file to itself then S3 will just update the metadata on the file. There are also various graphical frontends to S3 that can probably do this sort of bulk operation but I am not familiar with them

Fred

 
Reply all
Reply to author
Forward
0 new messages