On 17 February 2010 03:53, Leonard Richardson
<email address hidden> wrote:
> If you have a cache set up, it should be making conditional requests,
> and the conditional requests should be returning 304 ("Not Modified")
> because the service root only changes when we do a new release of
> launchpadlib. If we added a reasonable Cache-Control header when serving
> the WADL and JSON, launchpadlib would only try to retrieve these
> documents, say, once a week. This seems more practical than cramming the
> WADL and JSON representations into the same response and getting rid of
> one of the two requests.
I suspect a fair amount of time is in starting the connection, so just
sending not modified may not totally fix things, but it would
certainly help, and you're right it would be cleaner than trying to
squash them together. In fact the very crude view given by 'bugclient
--debug' does show some lag while getting the body - and the wadl is
over 1MB(!!) so avoiding that startup would help.
The requests obviously are not sending if-not-modified-since etc and
the server is sending an etag but no date.
send: 'GET /beta/ HTTP/1.1\r\nHost:
api.edge.launchpad.net\r\nAccept-Encoding: identity\r\nte: deflate,
gzip\r\nAuthorization: OAuth realm="OAuth", oauth_nonce="66438850",
oauth_timestamp="1266365634", oauth_consumer_key="Hydrazine",
oauth_signature_method="PLAINTEXT", oauth_version="1.0",
oauth_token="uuuuuuuuuuuuuuu",
oauth_signature="uuuuuuuuuuuuuuuuuuuu"\r\naccept:
application/vnd.sun.wadl+xml,
application/vd.sun.wadl+xml\r\nuser-agent:
Python-httplib2/$Rev$\r\n\r\n'
reply: 'HTTP/1.1 200 Ok\r\n'
header: Date: Wed, 17 Feb 2010 00:23:01 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: Content-Type: application/vnd.sun.wadl+xml
header: Content-Length: 1099105
header: Etag: "b81864b7425d7c9d586096a3362cf1f47e8ea99d"
header: Vary: Cookie,Authorization,Accept
header: Via: 1.1 wildcard.edge.launchpad.net
> (Do you have a cache set up? Was that HTTP dump on a fresh
> installation?)
I think I do have a cache; at least my client code is following the
launchpadlib instructions as they were a couple of months ago. You
can see it in lp:hydrazine.
On 17 February 2010 03:53, Leonard Richardson
<email address hidden> wrote:
> If you have a cache set up, it should be making conditional requests,
> and the conditional requests should be returning 304 ("Not Modified")
> because the service root only changes when we do a new release of
> launchpadlib. If we added a reasonable Cache-Control header when serving
> the WADL and JSON, launchpadlib would only try to retrieve these
> documents, say, once a week. This seems more practical than cramming the
> WADL and JSON representations into the same response and getting rid of
> one of the two requests.
I suspect a fair amount of time is in starting the connection, so just
sending not modified may not totally fix things, but it would
certainly help, and you're right it would be cleaner than trying to
squash them together. In fact the very crude view given by 'bugclient
--debug' does show some lag while getting the body - and the wadl is
over 1MB(!!) so avoiding that startup would help.
The requests obviously are not sending if-not- modified- since etc and
the server is sending an etag but no date.
send: 'GET /beta/ HTTP/1.1\r\nHost: launchpad. net\r\nAccept- Encoding: identity\r\nte: deflate, nAuthorization: OAuth realm="OAuth", oauth_nonce= "66438850" , ="1266365634" , oauth_consumer_ key="Hydrazine" , _method= "PLAINTEXT" , oauth_version= "1.0", "uuuuuuuuuuuuuu u", ="uuuuuuuuuuuuu uuuuuuu" \r\naccept: vnd.sun. wadl+xml, vd.sun. wadl+xml\ r\nuser- agent: httplib2/ $Rev$\r\ n\r\n' vnd.sun. wadl+xml 9d586096a3362cf 1f47e8ea99d" Authorization, Accept edge.launchpad. net
api.edge.
gzip\r\
oauth_timestamp
oauth_signature
oauth_token=
oauth_signature
application/
application/
Python-
reply: 'HTTP/1.1 200 Ok\r\n'
header: Date: Wed, 17 Feb 2010 00:23:01 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: Content-Type: application/
header: Content-Length: 1099105
header: Etag: "b81864b7425d7c
header: Vary: Cookie,
header: Via: 1.1 wildcard.
> (Do you have a cache set up? Was that HTTP dump on a fresh
> installation?)
I think I do have a cache; at least my client code is following the
launchpadlib instructions as they were a couple of months ago. You
can see it in lp:hydrazine.
~/.cache/ launchpadlib contains
total 5928 launchpad. net,beta, -application, json,5600078570 afb551b07f3697e c032007 launchpad. net,beta, pillars- application, json,6a86736a4b 082cccc2d62ff70 46425b2 launchpad. net,beta, -application, vnd.sun. wadl+xml, 8f29db2e0dac01f 431816a14846bf4 40 launchpad. net,beta, bzr-svn, +bug,522836- application, json,756aa788a7 5cb38ec3e0973cf c78ed8a launchpad. net,beta, bzr-application ,json,586e8acb7 964c1acbc76fee0 1d8345af launchpad. net,beta, bugs,522836- application, json,a27f0ded3a 6d64fe9547b7754 f99dff0 launchpad. net,beta, bugs,522836, bug_tasks- application, json,725c3fbc2b e928972c5c8393b 32f849e launchpad. net,beta, bugs,522603- application, json,dfb1c643c9 c8b5441c5e8396c f603959 launchpad. net,beta, bugs,240294- application, json,b455308708 09ef904cd17edcc 0889990 launchpad. net,beta, bugs,240924- application, json,3b262a0cb1 21d0133f7ef01d8 a879125
-rw-r--r-- 1 mbp 1324 2010-02-17 11:14
api.edge.
-rw-r--r-- 1 mbp 709 2010-02-17 11:14
api.edge.
-rw-r--r-- 1 mbp 1099573 2010-02-17 11:13
api.edge.
-rw-r--r-- 1 mbp 1541 2010-02-17 10:58
api.edge.
-rw-r--r-- 1 mbp 4626 2010-02-17 10:58
api.edge.
-rw-r--r-- 1 mbp 3642 2010-02-17 10:58
api.edge.
-rw-r--r-- 1 mbp 1570 2010-02-17 10:58
api.edge.
-rw-r--r-- 1 mbp 2672 2010-02-17 10:49
api.edge.
-rw-r--r-- 1 mbp 2734 2010-02-17 10:49
api.edge.
-rw-r--r-- 1 mbp 2307 2010-02-17 10:49
api.edge.
....
-- launchpad. net/~mbp/>
Martin <http://