def make_conditional(response, last_modified=None, etag=None, max_age=0):
 response.cache_control.must_revalidate = True
 response.cache_control.max_age = max_age
 if last_modified:
  response.last_modified = last_modified
 if etag:
  response.set_etag(etag)
 return response.make_conditional(request.httprequest)

def make_conditional ( response , last_modified = None , etag = None , max_age = 0 ) : response . cache_control . must_revalidate = True response . cache_control . max_age = max_age if last_modified : response . last_modified = last_modified if etag : response . set_etag ( etag ) return response . make_conditional ( request . httprequest )
makes the provided response conditional based upon the request .