← Back to team overview

launchpad-dev team mailing list archive

Re: Redesigning lazr.restful support for AJAX

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Francis J. Lacoste wrote:

> The client would request that one or more views be rendered after the 
> successful completion of the API call and their results returned to the 
> client.

This all sounds like it would be very useful, and be even easier than
reusing our existing +fragment stuff using Y.io.

If we're rethinking this stuff, it would be really nice to do further
latency-hiding on the request side.  For example, I have a plugin that
1. logs in
2. looks up branch lp:foo
3. looks up branch lp:bar
4. looks up person ~baz
5. creates a merge proposal for merging lp:foo into lp:bar, with ~baz as
a reviewer.
6. opens the local browser to the merge proposal URL.

This takes almost 30 seconds (on staging).  My profiling indicates ~ 90%
of it is doing branch and person lookups.

Steps 1-4 have no data dependencies, so they could easily be done as a
single request.  In fact, we're only determining the API URLs during
steps 2-4; we really ought to be able to do step 5 as our first step.

> We could use the accept-extension to the Accept header to specify the list of 
> views to return results.
> 
> Something like:
> 
> Accept: application/x-page-fragments;views="subscribers=+subscriber-portlets, 
> count=+subscribers-count"

The functionality is great.  I'll let others comment on the particular
implementation.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksCIZIACgkQ0F+nu1YWqI0B/gCfc4c0xBnUPh+QNdcUr85lmMAk
T44An0sF3ToQGgNNXUukKga/wYvmgYoo
=7IGr
-----END PGP SIGNATURE-----



References