couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "HTTP_Document_API" by JensAlfke
Date Wed, 21 Dec 2011 00:38:42 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "HTTP_Document_API" page has been changed by JensAlfke:
http://wiki.apache.org/couchdb/HTTP_Document_API?action=diff&rev1=87&rev2=88

Comment:
Describe atts_since option and revpos attachment attribute.

  
  Needless to say, this type of request can lead to arbitrarily large responses and can be
expensive for the server. Don't use it unless you need to; if you only want one or two attachments,
use individual GETs to fetch them.
  
+ 
+ === Getting Only Changed Attachments ===
+ 
+ If you already have a local copy of an earlier revision of a document and its attachments,
you may want to fetch only the attachments that have changed since a particular revision.
To do this, add a `?atts_since` parameter to the URL, whose value is a (URL-encoded) JSON
array of one or more revision IDs. The response will include the content of only those attachments
that changed since the given revision(s). (You can ask for this either in the default JSON
or as multipart/related, as previously described.)
+ 
+ Incidentally, you can always find out in which revision an attachment last changed by looking
at its metadata's `revpos` property, whose value is the numeric generation number (''not''
the full revision ID) of the revision that introduced that version of the attachment.
+ 
  === Compression of Attachments ===
  As of version 0.11, CouchDB, by default, will automatically compress certain attachment
types.  That is, based on the Content-Type header of the request CouchDB may perform compression
of the data.  This is done to reduce the amount of data being shuffled around during replication,
and in most cases it's probably what you want.  However, if uploading large files (e.g. a
200M CSV) you may want to tweak this configuration in order to avoid compression and therefore
reduce the network latency of the request.
  

Mime
View raw message