Current Path: > > usr > lib > python3.8 > site-packages > pip > _vendor > > > cachecontrol
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
caches | Directory | - | - | |
__init__.py | File | 302 bytes | October 17 2023 18:30:24. | |
_cmd.py | File | 1295 bytes | October 17 2023 18:30:24. | |
adapter.py | File | 4863 bytes | October 17 2023 18:30:24. | |
cache.py | File | 805 bytes | October 17 2023 18:30:24. | |
compat.py | File | 695 bytes | October 17 2023 18:30:24. | |
controller.py | File | 13698 bytes | October 17 2023 18:30:24. | |
filewrapper.py | File | 2533 bytes | October 17 2023 18:30:24. | |
heuristics.py | File | 4070 bytes | October 17 2023 18:30:24. | |
serialize.py | File | 6954 bytes | October 17 2023 18:30:24. | |
wrapper.py | File | 671 bytes | October 17 2023 18:30:24. |
import logging from pip._vendor import requests from pip._vendor.cachecontrol.adapter import CacheControlAdapter from pip._vendor.cachecontrol.cache import DictCache from pip._vendor.cachecontrol.controller import logger from argparse import ArgumentParser def setup_logging(): logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() logger.addHandler(handler) def get_session(): adapter = CacheControlAdapter( DictCache(), cache_etags=True, serializer=None, heuristic=None ) sess = requests.Session() sess.mount("http://", adapter) sess.mount("https://", adapter) sess.cache_controller = adapter.controller return sess def get_args(): parser = ArgumentParser() parser.add_argument("url", help="The URL to try and cache") return parser.parse_args() def main(args=None): args = get_args() sess = get_session() # Make a request to get a response resp = sess.get(args.url) # Turn on logging setup_logging() # try setting the cache sess.cache_controller.cache_response(resp.request, resp.raw) # Now try to get it if sess.cache_controller.cached_request(resp.request): print("Cached!") else: print("Not cached :(") if __name__ == "__main__": main()
SILENT KILLER Tool