Merge lp:~james-w/summit/cache-control into lp:~summit-hackers/summit/1.x

Proposed by Nigel Babu
Status: Merged
Approved by: Nigel Babu
Approved revision: 148
Merged at revision: 146
Proposed branch: lp:~james-w/summit/cache-control
Merge into: lp:~summit-hackers/summit/1.x
Diff against target: 16 lines (+4/-1)
1 file modified
summit/schedule/models/summitmodel.py (+4/-1)
To merge this branch: bzr merge lp:~james-w/summit/cache-control
Reviewer Review Type Date Requested Status
Nigel Babu (community) Approve
Review via email: mp+75265@code.launchpad.net

Commit message

Send headers to try and avoid the cache on the +temp-meeting-export page.

This stops Launchpad from serving a cached copy, which may be older than the last
one we saw, causing us to delete new blueprints.

We send Cache-Control as a request to do this, and Cookie as that currently makes
Launchpad bypass squid entirely.

Description of the change

Hi,

This branch adds the headers needed from https://bugs.launchpad.net/summit/+bug/849331,

This will stop lpupdate from deleting blueprints from summit, which is nice.

Thanks,

James

To post a comment you must log in.
lp:~james-w/summit/cache-control updated
147. By James Westby

Remove the print statement.

148. By James Westby

Also add a Cookie header to bypass squid entirely in Launchpad.

Revision history for this message
Nigel Babu (nigelbabu) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/schedule/models/summitmodel.py'
2--- summit/schedule/models/summitmodel.py 2011-07-19 01:30:45 +0000
3+++ summit/schedule/models/summitmodel.py 2011-09-13 22:47:29 +0000
4@@ -166,8 +166,11 @@
5 trycounter = 0
6 retrytotal = 5
7 while trycounter <= retrytotal:
8+ req = urllib2.Request(url)
9+ req.add_header("Cache-Control", "no-cache")
10+ req.add_header("Cookie", "please-don't-cache-me")
11 try:
12- export = urllib2.urlopen(url)
13+ export = urllib2.urlopen(req)
14 except urllib2.HTTPError, e:
15 trycounter += 1
16 if trycounter >= retrytotal:

Subscribers

People subscribed via source and target branches

to all changes: