Deflate files in Paperclip before upload.
Add the paperclip-deflater gem to your Gemfile.
gem "paperclip-deflater"
And run bundle install
.
class Something < ActiveRecord::Base
has_attached_file :js,
styles: {
gzip: {
processors: [:gzip],
format: 'js.gz',
s3_headers: { content_type: 'application/javascript', content_encoding: 'gzip' },
}
},
path: "test/:id.:extension"
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright (c) 2014 Daisuke Taniwaki. See LICENSE for details.