File: gridfs.md

package info (click to toggle)
python-requests-cache 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,024 kB
  • sloc: python: 7,029; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(gridfs)=
# GridFS
```{image} ../../_static/mongodb.png
```

[GridFS](https://docs.mongodb.com/manual/core/gridfs/) is a specification for storing large files
in MongoDB.

## Use Cases
Use this backend if you are using MongoDB and expect to store responses **larger than 16MB**. See
{py:mod}`~requests_cache.backends.mongodb` for more general info.

## Usage Example
Initialize with a {py:class}`.GridFSCache` instance:
```python
>>> from requests_cache import CachedSession, GridFSCache
>>> session = CachedSession(backend=GridFSCache())
```

Or by alias:
```python
>>> session = CachedSession(backend='gridfs')
```