Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/psf/cachecontrol
/ functions
Functions
218 in github.com/psf/cachecontrol
⨍
Functions
218
◇
Types & classes
47
↓ 99 callers
Method
get
(self, key: str)
cachecontrol/cache.py:20
↓ 17 callers
Function
CacheControl
( sess: requests.Session, cache: BaseCache | None = None, cache_etags: bool = True, serializer
cachecontrol/wrapper.py:20
↓ 15 callers
Method
encode
(x: str)
cachecontrol/caches/file_cache.py:55
↓ 12 callers
Method
cache_response
Algorithm for caching requests. This assumes a requests Response object.
cachecontrol/controller.py:324
↓ 11 callers
Method
_fn
(self, name: str)
cachecontrol/caches/file_cache.py:58
↓ 11 callers
Method
req
(self, headers)
tests/test_cache_control.py:231
↓ 10 callers
Method
close
(self)
cachecontrol/cache.py:31
↓ 10 callers
Method
read
(self, amt: int | None = None)
cachecontrol/filewrapper.py:99
↓ 10 callers
Method
req
(self, headers=None)
tests/test_cache_control.py:27
↓ 9 callers
Method
loads
(self, request, data, body_file=None)
tests/utils.py:14
↓ 9 callers
Method
resp
(self, headers=None)
tests/test_cache_control.py:31
↓ 7 callers
Method
update_headers
(self, resp)
tests/test_expires_heuristics.py:31
↓ 6 callers
Method
_cache_set
Store the data in the cache.
cachecontrol/controller.py:294
↓ 6 callers
Method
cache_url
(cls, uri: str)
cachecontrol/controller.py:86
↓ 6 callers
Method
delete
(self, key: str)
cachecontrol/cache.py:28
↓ 6 callers
Method
dumps
(self, request, response, body=None)
tests/utils.py:11
↓ 6 callers
Method
set
( self, key: str, value: bytes, expires: int | datetime | None = None )
cachecontrol/cache.py:23
↓ 5 callers
Method
last_modified
(self, period)
tests/test_expires_heuristics.py:133
↓ 4 callers
Method
cached_request
Return a cached response if it exists in the cache, otherwise return False.
cachecontrol/controller.py:169
↓ 4 callers
Method
parse_cache_control
(self, headers: Mapping[str, str])
cachecontrol/controller.py:89
↓ 3 callers
Method
_close
(self)
cachecontrol/filewrapper.py:71
↓ 3 callers
Method
_delete
(self, key: str, suffix: str)
cachecontrol/caches/file_cache.py:98
↓ 3 callers
Method
_load_from_cache
Load a cached response, or return None if it's not available.
cachecontrol/controller.py:143
↓ 3 callers
Method
cached_equal
(self, cached, resp)
tests/test_vary.py:23
↓ 3 callers
Method
dumps
( self, request: PreparedRequest, response: HTTPResponse, body: bytes | None =
cachecontrol/serialize.py:20
↓ 3 callers
Method
update_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 callers
Method
warning
(self, response: HTTPResponse)
cachecontrol/heuristics.py:92
↓ 2 callers
Method
__is_fp_closed
(self)
cachecontrol/filewrapper.py:53
↓ 2 callers
Method
_loads_v4
( self, request: PreparedRequest, data: bytes, body_file: IO[bytes] | None = N
cachecontrol/serialize.py:135
↓ 2 callers
Method
_write
Safely write the data to the given path.
cachecontrol/caches/file_cache.py:80
↓ 2 callers
Function
datetime_to_header
(dt: datetime)
cachecontrol/heuristics.py:23
↓ 2 callers
Function
expire_after
(delta: timedelta, date: datetime | None = None)
cachecontrol/heuristics.py:18
↓ 2 callers
Method
loads
( self, request: PreparedRequest, data: bytes, body_file: IO[bytes] | None = N
cachecontrol/serialize.py:65
↓ 2 callers
Function
randomdata
Plain random http data generator:
tests/test_storage_filecache.py:21
↓ 2 callers
Method
update_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 callers
Method
update_etag_string
(self)
tests/conftest.py:51
↓ 1 callers
Method
_urlnorm
Normalize the URL to create a safe key for the cache
cachecontrol/controller.py:66
↓ 1 callers
Method
apply
(self, response: HTTPResponse)
cachecontrol/heuristics.py:48
↓ 1 callers
Method
build_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 callers
Method
clear
Helper for clearing all the keys in a database. Use with caution!
cachecontrol/caches/redis_cache.py:40
↓ 1 callers
Method
close
Redis uses connection pooling, no need to close the connection.
cachecontrol/caches/redis_cache.py:46
↓ 1 callers
Method
conditional_headers
(self, request: PreparedRequest)
cachecontrol/controller.py:279
↓ 1 callers
Method
delete
(self, key: str)
cachecontrol/caches/redis_cache.py:37
↓ 1 callers
Method
dispatch
(self, env)
tests/conftest.py:18
↓ 1 callers
Function
get_args
()
cachecontrol/_cmd.py:40
↓ 1 callers
Method
get_body
Return the body as file-like object.
cachecontrol/cache.py:71
↓ 1 callers
Function
get_free_port
()
tests/conftest.py:150
↓ 1 callers
Function
get_session
()
cachecontrol/_cmd.py:28
↓ 1 callers
Function
log_resp
(resp)
tests/issue_263.py:31
↓ 1 callers
Function
main
()
cachecontrol/_cmd.py:46
↓ 1 callers
Function
parse_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 callers
Method
prepare_response
Verify our vary headers match and construct a real urllib3 HTTPResponse object.
cachecontrol/serialize.py:83
↓ 1 callers
Function
run
()
examples/benchmark.py:52
↓ 1 callers
Function
run_benchmark
(sess)
examples/benchmark.py:36
↓ 1 callers
Method
serialize
(self, data: dict[str, Any])
cachecontrol/serialize.py:62
↓ 1 callers
Method
set_body
(self, key: str, body: bytes)
cachecontrol/cache.py:68
↓ 1 callers
Function
setup_logging
()
cachecontrol/_cmd.py:22
↓ 1 callers
Method
update_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 callers
Method
warning
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
Method
cache_60
(self, env, start_response)
tests/conftest.py:73
Method
cc
(self)
tests/test_cache_control.py:38
Method
close
(self)
cachecontrol/adapter.py:165
Method
conditional_get
(self, env, start_response)
tests/conftest.py:61
Function
datetime_to_header
(dt)
tests/test_expires_heuristics.py:128
Method
delete
(self, key: str)
cachecontrol/cache.py:49
Method
delete
(self, key: str)
cachecontrol/caches/file_cache.py:113
Method
delete
(self, key: str)
cachecontrol/caches/file_cache.py:134
Method
etag
(self, env, start_response)
tests/conftest.py:64
Method
fixed_length
(self, env, start_response)
tests/conftest.py:104
Method
get
(self, key: str)
cachecontrol/cache.py:40
Method
get
(self, key: str)
cachecontrol/caches/file_cache.py:65
Method
get
(self, key: str)
cachecontrol/caches/redis_cache.py:20
Method
get_body
(self, key: str)
cachecontrol/caches/file_cache.py:123
Method
multiple_choices
(self, env, start_response)
tests/conftest.py:92
Method
no_cache
(self, env, start_response)
tests/conftest.py:78
Method
optional_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
Method
permalink
(self, env, start_response)
tests/conftest.py:88
Method
permanent_redirect
(self, env, start_response)
tests/conftest.py:83
Method
send
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
Function
server
()
tests/conftest.py:126
Function
sess
(url, request)
tests/test_adapter.py:32
Function
sess
()
tests/test_chunked_response.py:15
Method
sess
(self, url, tmpdir)
tests/test_storage_filecache.py:32
Method
sess
(self, url)
tests/test_etag.py:24
Method
sess
(self, server, url)
tests/test_etag.py:114
next →
1–100 of 218, ranked by callers