722 Return False if the page has to be calculated, else True. |
722 Return False if the page has to be calculated, else True. |
723 |
723 |
724 Some response cache headers may be set by this method. |
724 Some response cache headers may be set by this method. |
725 """ |
725 """ |
726 modified = True |
726 modified = True |
727 if self.get_header('Cache-Control') not in ('max-age=0', 'no-cache'): |
727 # Here, we search for any invalid 'not modified' condition |
728 # Here, we search for any invalid 'not modified' condition |
728 # see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3 |
729 # see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3 |
729 validators = get_validators(self._headers_in) |
730 validators = get_validators(self._headers_in) |
730 if validators: # if we have no |
731 if validators: # if we have no |
731 modified = any(func(val, self.headers_out) for func, val in validators) |
732 modified = any(func(val, self.headers_out) for func, val in validators) |
|
733 # Forge expected response |
732 # Forge expected response |
734 if modified: |
733 if modified: |
735 if 'Expires' not in self.headers_out: |
734 if 'Expires' not in self.headers_out: |
736 # Expires header seems to be required by IE7 -- Are you sure ? |
735 # Expires header seems to be required by IE7 -- Are you sure ? |
737 self.add_header('Expires', 'Sat, 01 Jan 2000 00:00:00 GMT') |
736 self.add_header('Expires', 'Sat, 01 Jan 2000 00:00:00 GMT') |