couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: view etags / COUCHDB-4
Date Mon, 16 Feb 2009 00:29:03 GMT

On 15 Feb 2009, at 21:45, Chris Anderson wrote:

> I've committed some changes to provide Etags on view requests.

Woohoo! Great work Chris :) Thanks.


Cheers
Jan
--

> Etags are provide for map and reduce view queries, both with and
> without POSTed keys (looking forward to adding a GET option for
> multi-key)
>
> They are also provided for list views.
>
> The Etags are calculated based on current update_seq for the view
> group record. This is normally the current seq of the db (unless you
> use stale=ok).
>
> The code presents an opportunity to track the last_modified_seq on a
> view group record. We're not tracking it yet but once we are we'll be
> potentially more cache efficient.
>
> Also, please test edge cases. Etags...
>
> Chris
>
> On Sun, Feb 15, 2009 at 12:36 PM,  <jchris@apache.org> wrote:
>> Author: jchris
>> Date: Sun Feb 15 20:36:53 2009
>> New Revision: 744747
>>
>> URL: http://svn.apache.org/viewvc?rev=744747&view=rev
>> Log:
>> View etags are now provided. See note in the source about how they  
>> could be more efficient. Changes arity on make_view_fold_fun etc.  
>> Closes COUCHDB-4
>>
>
>
>
>> +
>> +view_group_etag(Group) ->
>> +    view_group_etag(Group, nil).
>>
>> +view_group_etag(#group{sig=Sig,current_seq=CurrentSeq}, Extra) ->
>> +    % This is not as granular as it could be.
>> +    % If there are updates to the db that do not effect the view  
>> index,
>> +    % they will change the Etag. For more granular Etags we'd need  
>> to keep
>> +    % track of the last Db seq that caused an index change.
>> +    couch_httpd:make_etag({Sig, CurrentSeq, Extra}).
>>
>
>
>
>
>
> -- 
> Chris Anderson
> http://jchris.mfdz.com
>


Mime
View raw message