Overzealous Vary header prevents clients from caching service root representation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Unassigned |
Bug Description
using launchpadlib 1.5.4 from lucid, constructing a Launchpad instance apparently makes the same http call twice, adding about 3-5s to the startup time of any launchpadlib-using application:
loaded existing credentials
> /home/mbp/
-> return Launchpad(
(Pdb) n
> /home/mbp/
-> lplib_cachedir)
(Pdb)
send: 'GET /beta/ HTTP/1.1\r\nHost: api.edge.
reply: 'HTTP/1.1 200 Ok\r\n'
header: Date: Sun, 14 Feb 2010 22:39:33 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: "28a2b78bfdbb95
header: Vary: Cookie,
header: Via: 1.1 wildcard.
send: 'GET /beta/ HTTP/1.1\r\nHost: api.edge.
reply: 'HTTP/1.1 200 Ok\r\n'
header: Date: Sun, 14 Feb 2010 22:39:52 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: Content-Type: application/json
header: Content-Length: 913
header: Etag: "cebfdee8cd795f
header: Vary: Cookie,
header: Via: 1.1 wildcard.
--Return--
> /home/mbp/
-> lplib_cachedir)
(Pdb) launchpadlib
*** NameError: name 'launchpadlib' is not defined
(Pdb) import launchpadlib
(Pdb) launchpadlib.
'1.5.4'
Related branches
- Aaron Bentley (community): Approve
- Gary Poster (community): Approve
-
Diff: 215 lines (+135/-24) (has conflicts)5 files modifiedlib/canonical/launchpad/pagetests/webservice/launchpadlib.txt (+91/-19)
lib/canonical/launchpad/pagetests/webservice/xx-service.txt (+22/-0)
lib/canonical/launchpad/webapp/servers.py (+20/-2)
lib/canonical/launchpad/webapp/tests/test_servers.py (+1/-2)
versions.cfg (+1/-1)
Changed in launchpadlib: | |
status: | Invalid → New |
Changed in launchpadlib: | |
status: | Confirmed → Fix Committed |
affects: | launchpadlib → launchpad-foundations |
summary: |
- launchpadlib doesn't cache wadl; reads 1MB at startup + Overzealous Vary header prevents clients from caching service root + representation |
tags: | added: api |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
I guess it's actually getting different content because of the Accept header? Still, it would be nice to do only one round trip.