def try_to_serve_304(dispatch_result, request, etag):
 if (not etag):
  return
 qs_etag = request.line.uri.querystring.get('etag')
 if (qs_etag and (qs_etag != etag)):
  raise Response(410)
 headers_etag = request.headers.get('If-None-Match')
 if (not headers_etag):
  return
 if (headers_etag != etag):
  return
 raise Response(304)

def try_to_serve_304 ( dispatch_result , request , etag ) : if ( not etag ) : return qs_etag = request . line . uri . querystring . get ( 'etag' ) if ( qs_etag and ( qs_etag != etag ) ) : raise Response ( 410 ) headers_etag = request . headers . get ( 'If-None-Match' ) if ( not headers_etag ) : return if ( headers_etag != etag ) : return raise Response ( 304 )
try to serve a 304 for static resources .