MCPcopy Create free account

hub / github.com/psf/cachecontrol / functions

Functions218 in github.com/psf/cachecontrol

↓ 99 callersMethodget
(self, key: str)
cachecontrol/cache.py:20
↓ 17 callersFunctionCacheControl
( sess: requests.Session, cache: BaseCache | None = None, cache_etags: bool = True, serializer
cachecontrol/wrapper.py:20
↓ 15 callersMethodencode
(x: str)
cachecontrol/caches/file_cache.py:55
↓ 12 callersMethodcache_response
Algorithm for caching requests. This assumes a requests Response object.
cachecontrol/controller.py:324
↓ 11 callersMethod_fn
(self, name: str)
cachecontrol/caches/file_cache.py:58
↓ 11 callersMethodreq
(self, headers)
tests/test_cache_control.py:231
↓ 10 callersMethodclose
(self)
cachecontrol/cache.py:31
↓ 10 callersMethodread
(self, amt: int | None = None)
cachecontrol/filewrapper.py:99
↓ 10 callersMethodreq
(self, headers=None)
tests/test_cache_control.py:27
↓ 9 callersMethodloads
(self, request, data, body_file=None)
tests/utils.py:14
↓ 9 callersMethodresp
(self, headers=None)
tests/test_cache_control.py:31
↓ 7 callersMethodupdate_headers
(self, resp)
tests/test_expires_heuristics.py:31
↓ 6 callersMethod_cache_set
Store the data in the cache.
cachecontrol/controller.py:294
↓ 6 callersMethodcache_url
(cls, uri: str)
cachecontrol/controller.py:86
↓ 6 callersMethoddelete
(self, key: str)
cachecontrol/cache.py:28
↓ 6 callersMethoddumps
(self, request, response, body=None)
tests/utils.py:11
↓ 6 callersMethodset
( self, key: str, value: bytes, expires: int | datetime | None = None )
cachecontrol/cache.py:23
↓ 5 callersMethodlast_modified
(self, period)
tests/test_expires_heuristics.py:133
↓ 4 callersMethodcached_request
Return a cached response if it exists in the cache, otherwise return False.
cachecontrol/controller.py:169
↓ 4 callersMethodparse_cache_control
(self, headers: Mapping[str, str])
cachecontrol/controller.py:89
↓ 3 callersMethod_close
(self)
cachecontrol/filewrapper.py:71
↓ 3 callersMethod_delete
(self, key: str, suffix: str)
cachecontrol/caches/file_cache.py:98
↓ 3 callersMethod_load_from_cache
Load a cached response, or return None if it's not available.
cachecontrol/controller.py:143
↓ 3 callersMethodcached_equal
(self, cached, resp)
tests/test_vary.py:23
↓ 3 callersMethoddumps
( self, request: PreparedRequest, response: HTTPResponse, body: bytes | None =
cachecontrol/serialize.py:20
↓ 3 callersMethodupdate_cached_response
On a 304 we will get a new set of headers that we want to update our cached value with, assuming we have one. This should only ever b
cachecontrol/controller.py:471
↓ 3 callersMethodwarning
(self, response: HTTPResponse)
cachecontrol/heuristics.py:92
↓ 2 callersMethod__is_fp_closed
(self)
cachecontrol/filewrapper.py:53
↓ 2 callersMethod_loads_v4
( self, request: PreparedRequest, data: bytes, body_file: IO[bytes] | None = N
cachecontrol/serialize.py:135
↓ 2 callersMethod_write
Safely write the data to the given path.
cachecontrol/caches/file_cache.py:80
↓ 2 callersFunctiondatetime_to_header
(dt: datetime)
cachecontrol/heuristics.py:23
↓ 2 callersFunctionexpire_after
(delta: timedelta, date: datetime | None = None)
cachecontrol/heuristics.py:18
↓ 2 callersMethodloads
( self, request: PreparedRequest, data: bytes, body_file: IO[bytes] | None = N
cachecontrol/serialize.py:65
↓ 2 callersFunctionrandomdata
Plain random http data generator:
tests/test_storage_filecache.py:21
↓ 2 callersMethodupdate_cached_response_with_valid_headers_test
If the local cache has the given URL ``update_cached_response()`` will: 1. Load the body from the cache. 2. Update the store
tests/test_cache_control.py:170
↓ 2 callersMethodupdate_etag_string
(self)
tests/conftest.py:51
↓ 1 callersMethod_urlnorm
Normalize the URL to create a safe key for the cache
cachecontrol/controller.py:66
↓ 1 callersMethodapply
(self, response: HTTPResponse)
cachecontrol/heuristics.py:48
↓ 1 callersMethodbuild_response
Build a response by making a request or using the cache. This will end up calling send and returning a potentially cached re
cachecontrol/adapter.py:80
↓ 1 callersMethodclear
Helper for clearing all the keys in a database. Use with caution!
cachecontrol/caches/redis_cache.py:40
↓ 1 callersMethodclose
Redis uses connection pooling, no need to close the connection.
cachecontrol/caches/redis_cache.py:46
↓ 1 callersMethodconditional_headers
(self, request: PreparedRequest)
cachecontrol/controller.py:279
↓ 1 callersMethoddelete
(self, key: str)
cachecontrol/caches/redis_cache.py:37
↓ 1 callersMethoddispatch
(self, env)
tests/conftest.py:18
↓ 1 callersFunctionget_args
()
cachecontrol/_cmd.py:40
↓ 1 callersMethodget_body
Return the body as file-like object.
cachecontrol/cache.py:71
↓ 1 callersFunctionget_free_port
()
tests/conftest.py:150
↓ 1 callersFunctionget_session
()
cachecontrol/_cmd.py:28
↓ 1 callersFunctionlog_resp
(resp)
tests/issue_263.py:31
↓ 1 callersFunctionmain
()
cachecontrol/_cmd.py:46
↓ 1 callersFunctionparse_uri
Parses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri)
cachecontrol/controller.py:39
↓ 1 callersMethodprepare_response
Verify our vary headers match and construct a real urllib3 HTTPResponse object.
cachecontrol/serialize.py:83
↓ 1 callersFunctionrun
()
examples/benchmark.py:52
↓ 1 callersFunctionrun_benchmark
(sess)
examples/benchmark.py:36
↓ 1 callersMethodserialize
(self, data: dict[str, Any])
cachecontrol/serialize.py:62
↓ 1 callersMethodset_body
(self, key: str, body: bytes)
cachecontrol/cache.py:68
↓ 1 callersFunctionsetup_logging
()
cachecontrol/_cmd.py:22
↓ 1 callersMethodupdate_headers
Update the response headers with any new headers. NOTE: This SHOULD always include some Warning header to signify that the resp
cachecontrol/heuristics.py:39
↓ 1 callersMethodwarning
Return a valid 1xx warning header value describing the cache adjustments. The response is provided too allow warnings like 1
cachecontrol/heuristics.py:28
Method__call__
(self, env, start_response)
tests/conftest.py:114
Method__call__
(self, env, sr)
examples/benchmark.py:20
Method__getattr__
(self, name: str)
cachecontrol/filewrapper.py:41
Method__init__
(self, status, headers)
tests/utils.py:28
Method__init__
(self, url, headers)
tests/utils.py:36
Method__init__
(self)
tests/conftest.py:14
Method__init__
( self, cache: BaseCache | None = None, cache_etags: bool = True, controller_c
cachecontrol/adapter.py:29
Method__init__
(self, init_dict: MutableMapping[str, bytes] | None = None)
cachecontrol/cache.py:36
Method__init__
( self, cache: BaseCache | None = None, cache_etags: bool = True, serializer:
cachecontrol/controller.py:53
Method__init__
( self, fp: HTTPResponse, callback: Callable[[Buffer], None] | None )
cachecontrol/filewrapper.py:34
Method__init__
(self, **kw: Any)
cachecontrol/heuristics.py:85
Method__init__
( self, directory: str | Path, forever: bool = False, filemode: int = 0o0600,
cachecontrol/caches/file_cache.py:25
Method__init__
(self, conn: Redis[bytes])
cachecontrol/caches/redis_cache.py:17
Method_safe_read
(self, amt: int)
cachecontrol/filewrapper.py:110
Method_update_chunk_length
( weak_self: weakref.ReferenceType[HTTPResponse], )
cachecontrol/adapter.py:137
Methodcache_60
(self, env, start_response)
tests/conftest.py:73
Methodcc
(self)
tests/test_cache_control.py:38
Methodclose
(self)
cachecontrol/adapter.py:165
Methodconditional_get
(self, env, start_response)
tests/conftest.py:61
Functiondatetime_to_header
(dt)
tests/test_expires_heuristics.py:128
Methoddelete
(self, key: str)
cachecontrol/cache.py:49
Methoddelete
(self, key: str)
cachecontrol/caches/file_cache.py:113
Methoddelete
(self, key: str)
cachecontrol/caches/file_cache.py:134
Methodetag
(self, env, start_response)
tests/conftest.py:64
Methodfixed_length
(self, env, start_response)
tests/conftest.py:104
Methodget
(self, key: str)
cachecontrol/cache.py:40
Methodget
(self, key: str)
cachecontrol/caches/file_cache.py:65
Methodget
(self, key: str)
cachecontrol/caches/redis_cache.py:20
Methodget_body
(self, key: str)
cachecontrol/caches/file_cache.py:123
Methodmultiple_choices
(self, env, start_response)
tests/conftest.py:92
Methodno_cache
(self, env, start_response)
tests/conftest.py:78
Methodoptional_cacheable_request
A request with no hints as to whether it should be cached. Yet, we might still choose to cache it via a heuristic.
tests/conftest.py:26
Methodpermalink
(self, env, start_response)
tests/conftest.py:88
Methodpermanent_redirect
(self, env, start_response)
tests/conftest.py:83
Methodsend
Send a request. Use the request information to see if it exists in the cache and cache the response if we need to and can.
cachecontrol/adapter.py:50
Functionserver
()
tests/conftest.py:126
Functionsess
(url, request)
tests/test_adapter.py:32
Functionsess
()
tests/test_chunked_response.py:15
Methodsess
(self, url, tmpdir)
tests/test_storage_filecache.py:32
Methodsess
(self, url)
tests/test_etag.py:24
Methodsess
(self, server, url)
tests/test_etag.py:114
next →1–100 of 218, ranked by callers