On 8/13/13 10:43 PM, Christian wrote: > On 13.08.2013 09:20, Karsten Loesing wrote: >> On 8/12/13 10:56 PM, Christian wrote: >>> I've seen that you've included the field parameter to limit the fields >>> that onionoo returns. >>> Do you think it would be better to use the field parameter and show a >>> limited amount of data or try to get everything and only display the >>> fields that have a value? >> You mean for details pages? I'd say display everything that has a >> value. Unless I didn't understand your question. >> >> But here's something else that just came to mind that you could do with >> the fields parameter: in the search part, instead of sending a request >> for the summary document, just request the details documents, but only >> ask for the fields you're planning to display in the table. Once the >> user wants to see the details page, you'll have to fetch the full >> details for that relay or bridge. But you should be able to save quite >> a few requests and make the client application even more responsive. > > That's a gread idea. I just implemented it in a new branch and it works > so far. > Without any futher testing it looks like the size for a single detail > request went from ~1.9KB to ~1KB.
Hmm, when you say "single detail request", I wonder if I explained my idea correctly. Let me try again, this time with an example: Assume somebody searches for "gab". This currently generates the following requests to Onionoo: [10:32:16.950] GET https://onionoo.torproject.org/summary?limit=50&search=gab [HTTP/1.1 304 Not Modified 141ms] [10:32:17.108] GET https://onionoo.torproject.org/details?lookup=A79E50FC2C7C8B19D44778C39BD3B58361AC8A56 [HTTP/1.1 304 Not Modified 140ms] [10:32:17.110] GET https://onionoo.torproject.org/details?lookup=B94F71EA1A0D7E904200A20C9063B085D67CCF25 [HTTP/1.1 304 Not Modified 280ms] [10:32:17.111] GET https://onionoo.torproject.org/details?lookup=16EF359C2FBF50FC08CF9A95717BE3060575B67E [HTTP/1.1 304 Not Modified 417ms] My idea was to turn these requests into a single request: https://onionoo.torproject.org/details?limit=50&search=gab&fields=nickname,advertised_bandwidth,last_restarted,country,flags,or_addresses,dir_address,fingerprint And once somebody wants to look at gabelmoo's details, just download the full details document, plus bandwidth and weights for the graphs: [10:32:17.111] GET https://onionoo.torproject.org/details?lookup=16EF359C2FBF50FC08CF9A95717BE3060575B67E [HTTP/1.1 304 Not Modified 417ms] [10:36:44.356] GET https://onionoo.torproject.org/weights?lookup=16EF359C2FBF50FC08CF9A95717BE3060575B67E [HTTP/1.1 200 OK 686ms] [10:36:44.357] GET https://onionoo.torproject.org/bandwidth?lookup=16EF359C2FBF50FC08CF9A95717BE3060575B67E [HTTP/1.1 200 OK 442ms] All the best, Karsten _______________________________________________ tor-dev mailing list [email protected] https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
