1. 14 Jan, 2011 1 commit
  2. 02 Jan, 2011 1 commit
  3. 29 Dec, 2010 2 commits
  4. 15 Dec, 2010 1 commit
  5. 14 Dec, 2010 3 commits
  6. 23 Nov, 2010 3 commits
  7. 22 Nov, 2010 1 commit
  8. 12 Nov, 2010 1 commit
  9. 10 Nov, 2010 1 commit
  10. 09 Nov, 2010 2 commits
  11. 26 Oct, 2010 3 commits
  12. 12 Oct, 2010 2 commits
  13. 08 Oct, 2010 1 commit
  14. 07 Oct, 2010 3 commits
  15. 06 Oct, 2010 3 commits
  16. 01 Oct, 2010 1 commit
  17. 19 Aug, 2010 1 commit
  18. 18 Aug, 2010 4 commits
  19. 17 Aug, 2010 2 commits
  20. 16 Aug, 2010 3 commits
    • Added fingerprinting support · 2cdeb39a
      Leverage browser caching and proxy caching by setting far future Expires
      headers and changing filenames when file contents change. This can make
      your web app faster for users and also reduce your bandwidth costs.
      
      By adding the column :avatar_fingerprint to our db table and including
      :fingerprint in the attachment filename, we ensure the filename will
      change whenever the file contents do.
      
        has_attached_file :avatar,
          :styles => { :medium => "300x300>", :thumb => "100x100>" },
          :path => "users/:id/:attachment/:fingerprint-:style.:extension",
          :storage => :s3,
          :s3_headers => {'Expires' => 1.year.from_now.httpdate},
          :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
          :include_updated_timestamp => false
      
      This enables us to set far future expire headers so that browsers
      don't need to check for a newer version. If a change does occur,
      say because a user uploads a new avatar, the new filename will
      be rendered in your html and the cached version will be ignored.
      
      The example above will set Expires headers in S3. If you're using
      local storage you can configure your webserver to do something similar.
      
      We disable the timestamped query string because some proxies refuse
      to cache items with query strings.
      
      For more info on optimizing for caching:
      
      http://code.google.com/speed/page-speed/docs/caching.html
      Mike Bailey committed
  21. 10 Aug, 2010 1 commit