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

Method __init__

cachecontrol/adapter.py:29–48  ·  view source on GitHub ↗
(
        self,
        cache: BaseCache | None = None,
        cache_etags: bool = True,
        controller_class: type[CacheController] | None = None,
        serializer: Serializer | None = None,
        heuristic: BaseHeuristic | None = None,
        cacheable_methods: Collection[str] | None = None,
        *args: Any,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

27 invalidating_methods = {"PUT", "PATCH", "DELETE"}
28
29 def __init__(
30 self,
31 cache: BaseCache | None = None,
32 cache_etags: bool = True,
33 controller_class: type[CacheController] | None = None,
34 serializer: Serializer | None = None,
35 heuristic: BaseHeuristic | None = None,
36 cacheable_methods: Collection[str] | None = None,
37 *args: Any,
38 **kw: Any,
39 ) -> None:
40 super().__init__(*args, **kw)
41 self.cache = DictCache() if cache is None else cache
42 self.heuristic = heuristic
43 self.cacheable_methods = cacheable_methods or ("GET",)
44
45 controller_factory = controller_class or CacheController
46 self.controller = controller_factory(
47 self.cache, cache_etags=cache_etags, serializer=serializer
48 )
49
50 def send(
51 self,

Callers

nothing calls this directly

Calls 1

DictCacheClass · 0.90

Tested by

no test coverage detected