comparison MoinMoin/request/__init__.py @ 2933:5ad34b3541e6

only set Expires: header once for cache disabling
author Johannes Berg <johannes AT sipsolutions DOT net>
date Tue, 30 Oct 2007 14:34:57 +0100
parents 27d192ebd485
children 2521eb511f77
comparison
equal deleted inserted replaced
2932:27d192ebd485 2933:5ad34b3541e6
1546 #self.setHttpHeader('Cache-Control: no-cache="set-cookie", private, max-age=0') 1546 #self.setHttpHeader('Cache-Control: no-cache="set-cookie", private, max-age=0')
1547 self.setHttpHeader('Cache-Control: private, must-revalidate, max-age=10') 1547 self.setHttpHeader('Cache-Control: private, must-revalidate, max-age=10')
1548 elif level == 2: 1548 elif level == 2:
1549 self.setHttpHeader('Cache-Control: no-cache') 1549 self.setHttpHeader('Cache-Control: no-cache')
1550 1550
1551 # Set Expires for http 1.0 caches (does not support Cache-Control) 1551 # only do this once to avoid 'duplicate header' warnings
1552 when = time.time() - (3600 * 24 * 365) 1552 # (in case the caching disabling is being made stricter)
1553 self.setHttpHeader('Expires: %s' % self.httpDate(when=when)) 1553 if not self.http_caching_disabled:
1554 # Set Expires for http 1.0 caches (does not support Cache-Control)
1555 when = time.time() - (3600 * 24 * 365)
1556 self.setHttpHeader('Expires: %s' % self.httpDate(when=when))
1554 1557
1555 # Set Pragma for http 1.0 caches 1558 # Set Pragma for http 1.0 caches
1556 # See http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2068.html#sec-14.32 1559 # See http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2068.html#sec-14.32
1557 # DISABLED for level == 1 to fix IE https file attachment downloading trouble. 1560 # DISABLED for level == 1 to fix IE https file attachment downloading trouble.
1558 if level == 2: 1561 if level == 2: