Skip to content

Commit 202d03c

Browse files
author
Richard Jones
committed
tell clients/caches not to cache our dynamic bits
1 parent 0516870 commit 202d03c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

roundup/cgi/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.30 2002-09-12 06:05:34 richard Exp $
1+
# $Id: client.py,v 1.31 2002-09-12 07:00:41 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -141,6 +141,12 @@ def main(self):
141141
# and self.template, and may also append error/ok_messages)
142142
self.handle_action()
143143
# now render the page
144+
145+
# we don't want clients caching our dynamic pages
146+
self.additional_headers['Cache-Control'] = 'no-cache'
147+
self.additional_headers['Pragma'] = 'no-cache'
148+
self.additional_headers['Expires'] = 'Thu, 1 Jan 1970 00:00:00 GMT'
149+
144150
if self.form.has_key(':contentonly'):
145151
# just the content
146152
self.write(self.content())
@@ -409,7 +415,10 @@ def header(self, headers=None, response=None):
409415
headers = {'Content-Type':'text/html'}
410416
if response is None:
411417
response = self.response_code
418+
419+
# update with additional info
412420
headers.update(self.additional_headers)
421+
413422
if not headers.has_key('Content-Type'):
414423
headers['Content-Type'] = 'text/html'
415424
self.request.send_response(response)

0 commit comments

Comments
 (0)