(filesystem)=
This backend stores responses in files on the local filesystem, with one file per response.
This backend is useful if you would like to use your cached response data outside of requests-cache, for example:
Initialize with a {py:class}.FileCache instance:
>>> from requests_cache import CachedSession, FileCache >>> session = CachedSession(backend=FileCache())
Or by alias:
>>> session = CachedSession(backend='filesystem')
By default, responses are saved as JSON files. If you prefer a deiffernt format, you can use of the other available {ref}serializers or provide your own. For example, to save responses as YAML files (requires pyyaml):
>>> session = CachedSession('~/http_cache', backend='filesystem', serializer='yaml') >>> session.get('https://httpbin.org/get') >>> print(list(session.cache.paths())) > ['/home/user/http_cache/4dc151d95200ec.yaml']
files for general info on specifying cache paths<cache_name>/<cache_key><cache_name>/redirects.sqlite.FileCache.paths to get a list of all cached response paths