title: Rails carrierwave very slow upload with animated gif even with small file size
body: <p>I'm trying to upload an animated gif with just <strong>611KB</strong> file size and its taking about <strong>30</strong> to <strong>40 seconds</strong> or longer than that to finish. I've already adjusted my server configuration <strong>client_max_body_size</strong> to accept <strong>10MB</strong> file upload, and it's already working fine and not taking too long like the problem that i'm stating right now with jpg, jpeg and png files as per tested. I'm not sure if the cause of this is in the server configuration or the process of generating versions of the file by carrierwave that i have pasted in here. I did a lot of research already but it seems i can't find same problem as i have. By the way i am using a javascript uploader on this. Does any one here encountered the same problem with Rails carrierwave?</p>
  
  <p>And also i have this message in my firebug:</p>
  
  <pre><code>... POST data request size limit has been reached by Firebug. ...
  </code></pre>
  
  <p>Here's the gems that i used and carrierwave code for my uploader:</p>
  
  <pre><code>gem 'carrierwave'
  gem 'carrierwave-aws'
  gem 'carrierwave-base64'
  </code></pre>
  
  <p>app/uploaders/photo_uploader.rb</p>
  
  <pre><code>require 'securerandom'
  
  class PhotoUploader &lt; CarrierWave::Uploader::Base
  
    include CarrierWave::RMagick
    storage :aws
  
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  
    process :auto_orient
    def auto_orient
      manipulate! do |img|
        img.auto_orient!
        img = yield(img) if block_given?
        img
      end
    end
  
    version :scaled_512 do
      process :resize_to_fit =&gt; [512, 512]
    end
  
    version :thumb_425, from_version: :scaled_512 do
      process :resize_to_fill =&gt; [425, 212]
    end
  
    version :thumb_256, from_version: :scaled_512 do
      process :resize_to_fill =&gt; [256, 256]
    end
  
    def remove!
      begin
        super
      rescue Fog::Storage::Rackspace::NotFound
      end
    end
  
    def extension_white_list
      %w(jpg jpeg gif png)
    end
  
    def filename
      "#{secure_token}.#{file.extension}" if original_filename.present?
    end
  
    protected
    def secure_token
      var = :"@#{mounted_as}_secure_token"
      model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
    end
  
  end
  </code></pre>