Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-583

storing attachments in compressed form and serving them in compressed form if accepted by the client

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • CouchDB trunk

    Description

      This feature allows Couch to gzip compress attachments as they are being received and store them in compressed form.

      When a client asks for downloading an attachment (e.g. GET somedb/somedoc/attachment.txt), the attachment is sent in compressed form if the client's http request has gzip specified as a valid transfer encoding for the response (using the http header "Accept-Encoding"). Otherwise couch decompresses the attachment before sending it back to the client.

      Attachments are compressed only if their MIME type matches one of those listed in a separate config file. Compression level is also configurable in the default.ini file.

      This follows Damien's suggestion from 30 November:

      "Perhaps we need a separate user editable ini file to specify compressable or non-compressable files (would probably be too big for the regular ini file). What do other web servers do?

      Also, a potential optimization is to compress the file while writing to disk, and serve the compressed bytes directly to clients that can handle it, and decompressed for those that can't. For compressable types, it's a win for both disk IO for reads and writes, and CPU on read."

      Patch attached.

      Attachments

        1. couchdb-583-trunk-10th-try.patch
          80 kB
          Filipe David Borba Manana
        2. couchdb-583-trunk-11th-try.patch
          82 kB
          Filipe David Borba Manana
        3. couchdb-583-trunk-12th-try.patch
          79 kB
          Filipe David Borba Manana
        4. couchdb-583-trunk-13th-try.patch
          78 kB
          Filipe David Borba Manana
        5. couchdb-583-trunk-14th-try-git.patch
          82 kB
          Filipe David Borba Manana
        6. couchdb-583-trunk-15th-try-git.patch
          82 kB
          Filipe David Borba Manana
        7. couchdb-583-trunk-16th-try-git.patch
          82 kB
          Filipe David Borba Manana
        8. couchdb-583-trunk-17th-try-git.patch
          85 kB
          Filipe David Borba Manana
        9. couchdb-583-trunk-18th-try-git.patch
          65 kB
          Filipe David Borba Manana
        10. couchdb-583-trunk-3rd-try.patch
          46 kB
          Filipe David Borba Manana
        11. couchdb-583-trunk-4th-try-trunk.patch
          61 kB
          Filipe David Borba Manana
        12. couchdb-583-trunk-5th-try.patch
          68 kB
          Filipe David Borba Manana
        13. couchdb-583-trunk-6th-try.patch
          72 kB
          Filipe David Borba Manana
        14. couchdb-583-trunk-7th-try.patch
          74 kB
          Filipe David Borba Manana
        15. couchdb-583-trunk-8th-try.patch
          76 kB
          Filipe David Borba Manana
        16. couchdb-583-trunk-9th-try.patch
          76 kB
          Filipe David Borba Manana
        17. jira-couchdb-583-1st-try-trunk.patch
          29 kB
          Filipe David Borba Manana
        18. jira-couchdb-583-2nd-try-trunk.patch
          29 kB
          Filipe David Borba Manana

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fdmanana Filipe David Borba Manana
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: