'Checks the ``Etag`` header against requests\'s ``If-None-Match``.
Returns ``True`` if the request\'s Etag matches and a 304 should be
returned. For example::
self.set_etag_header()
if self.check_etag_header():
self.set_status(304)
return
This method is called automatically when the request is finished,
but may be called earlier for applications that override
`compute_etag` and want to do an early check for ``If-None-Match``
before completing the request.  The ``Etag`` header should be set
(perhaps with `set_etag_header`) before calling this method.'

def check_etag_header(self):

    etag = self._headers.get('Etag')
    inm = utf8(self.request.headers.get('If-None-Match', ''))
    return bool((etag and inm and (inm.find(etag) >= 0)))
