Backend for CacheControl using uwsgi's caching framework.
Only works inside of uWSGI (the uwsgi
module must be importable), and needs a configured cache (see uWSGI's --cache2
option) to work.
For an example uWSGI setup with a working cache, see test_app.py and its integration tests inside the repository. It's a test application that doesn't use CacheControl but has a configured cache that works.
import requests
from cachecontrol import CacheControl
from cachecontrol_uwsgi import UWSGICache
cached_session = CacheControl(requests.session(), cache=UWSGICache("cache_name"))
response = cached_session.get("http://httpbin.org/status/200")