MCPcopy Create free account
hub / github.com/psf/cachecontrol / optional_cacheable_request

Method optional_cacheable_request

tests/conftest.py:26–38  ·  view source on GitHub ↗

A request with no hints as to whether it should be cached. Yet, we might still choose to cache it via a heuristic.

(self, env, start_response)

Source from the content-addressed store, hash-verified

24 return None
25
26 def optional_cacheable_request(self, env, start_response):
27 """A request with no hints as to whether it should be
28 cached. Yet, we might still choose to cache it via a
29 heuristic."""
30
31 headers = [
32 ("server", "nginx/1.2.6 (Ubuntu)"),
33 ("last-modified", "Mon, 21 Jul 2014 17:45:39 GMT"),
34 ("content-type", "text/html"),
35 ]
36
37 start_response("200 OK", headers)
38 return [pformat(env).encode("utf8")]
39
40 def vary_accept(self, env, start_response):
41 response = pformat(env).encode("utf8")

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected