MCPcopy Create free account
hub / github.com/EasyIME/PIME / compute_etag

Method compute_etag

python/python3/tornado/web.py:2689–2702  ·  view source on GitHub ↗

Sets the ``Etag`` header based on static url version. This allows efficient ``If-None-Match`` checks against cached versions, and sends the correct ``Etag`` for a partial response (i.e. the same ``Etag`` as the full file). .. versionadded:: 3.1

(self)

Source from the content-addressed store, hash-verified

2687 assert self.request.method == "HEAD"
2688
2689 def compute_etag(self) -> Optional[str]:
2690 """Sets the ``Etag`` header based on static url version.
2691
2692 This allows efficient ``If-None-Match`` checks against cached
2693 versions, and sends the correct ``Etag`` for a partial response
2694 (i.e. the same ``Etag`` as the full file).
2695
2696 .. versionadded:: 3.1
2697 """
2698 assert self.absolute_path is not None
2699 version_hash = self._get_cached_version(self.absolute_path)
2700 if not version_hash:
2701 return None
2702 return '"%s"' % (version_hash,)
2703
2704 def set_headers(self) -> None:
2705 """Sets the content and caching headers on the response.

Callers

nothing calls this directly

Calls 1

_get_cached_versionMethod · 0.95

Tested by

no test coverage detected