couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: Rewrite inside of a path segment
Date Fri, 26 Oct 2012 09:09:20 GMT
I'm not opposed to multiple ways to rewrite, though it does make a
good case for the URL rewriter to become a plugin rather than core
(and there are other features that might be better extracted as
optional plugins).

What I am opposed to is a rewrite method that will be so slow as to be
unusable. Excluding the roundtrip to couchjs itself, it seems the
rewrite function is transferred to the view server and compiled on
every call. We do this in other places, it's true, but it's
regrettable. Would this be fast enough, though?

Finally, the native view server would also need this feature, it can't
be javascript-only.


On 26 October 2012 08:49, Benoit Chesneau <> wrote:
> On Thu, Oct 25, 2012 at 9:21 PM, Robin Berjon <> wrote:
>> On 25/10/2012 19:50 , Benoit Chesneau wrote:
>>> Well first version of the rewriter was based on a function [1]. After
>>> long discussions it wasn't accepted for performances reasons. I'm not
>>> sure we should accept it for now until we change the js evaluation.
>> Performance reasons would be problematic if it were the only option. But
>> since this is just one option, I reckon it should be okay. Also note that
>> I'd be happy to add caching at some point; I've been wondering if it should
>> vary with userCtx or not (I'm leaning towards not but unsure).
> I don't think it's good to have multiple options to handle rewrite.
> Also most of the time you want a function is because you aren't doing
> a fully restful rewriter.  I think the proposal in couchapp-ng gives
> you a lot of flexibility by using regexp. At the end this is what do
> most of the frameworks. And somehow is like mongrel2 at this point.
> - benoit

View raw message