def tee_output():
 request = cherrypy.serving.request
 if ('no-store' in request.headers.values('Cache-Control')):
  return
 def tee(body):
  'Tee response.body into a list.'
  if (('no-cache' in response.headers.values('Pragma')) or ('no-store' in response.headers.values('Cache-Control'))):
   for chunk in body:
    (yield chunk)
   return
  output = []
  for chunk in body:
   output.append(chunk)
   (yield chunk)
  body = ntob('').join(output)
  cherrypy._cache.put((response.status, (response.headers or {}), body, response.time), len(body))
 response = cherrypy.serving.response
 response.body = tee(response.body)

def tee_output ( ) : request = cherrypy . serving . request if ( 'no-store' in request . headers . values ( 'Cache-Control' ) ) : return def tee ( body ) : if ( ( 'no-cache' in response . headers . values ( 'Pragma' ) ) or ( 'no-store' in response . headers . values ( 'Cache-Control' ) ) ) : for chunk in body : ( yield chunk ) return output = [ ] for chunk in body : output . append ( chunk ) ( yield chunk ) body = ntob ( '' ) . join ( output ) cherrypy . _cache . put ( ( response . status , ( response . headers or { } ) , body , response . time ) , len ( body ) ) response = cherrypy . serving . response response . body = tee ( response . body )
tee response output to cache storage .