summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-22 17:31:44 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-22 20:27:23 -0500
commit12b7ebe4ea4a938884b10d8b676c7504b7996017 (patch)
tree263f322d9eb23c5278e69168220ae2c9e2091de1 /docs
parent35b48cf3486e546a5e4090e8e410b698e8a6b7be (diff)
downloadrequests-cache-12b7ebe4ea4a938884b10d8b676c7504b7996017.tar.gz
Update docs and changelog
Diffstat (limited to 'docs')
-rw-r--r--docs/user_guide/backends/filesystem.md14
-rw-r--r--docs/user_guide/backends/redis.md3
-rw-r--r--docs/user_guide/expiration.md6
3 files changed, 8 insertions, 15 deletions
diff --git a/docs/user_guide/backends/filesystem.md b/docs/user_guide/backends/filesystem.md
index 9fdee7c..07e41c4 100644
--- a/docs/user_guide/backends/filesystem.md
+++ b/docs/user_guide/backends/filesystem.md
@@ -26,17 +26,9 @@ Or by alias:
```
## File Formats
-By default, responses are saved as pickle files. If you want to save responses in a human-readable
-format, you can use one of the other available {ref}`serializers`. For example, to save responses as
-JSON files:
-```python
->>> session = CachedSession('~/http_cache', backend='filesystem', serializer='json')
->>> session.get('https://httpbin.org/get')
->>> print(list(session.cache.paths()))
-> ['/home/user/http_cache/4dc151d95200ec.json']
-```
-
-Or as YAML (requires `pyyaml`):
+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`):
```python
>>> session = CachedSession('~/http_cache', backend='filesystem', serializer='yaml')
>>> session.get('https://httpbin.org/get')
diff --git a/docs/user_guide/backends/redis.md b/docs/user_guide/backends/redis.md
index cfe1898..141834c 100644
--- a/docs/user_guide/backends/redis.md
+++ b/docs/user_guide/backends/redis.md
@@ -47,6 +47,9 @@ or disabled entirely. See [Redis Persistence](https://redis.io/topics/persistenc
Redis natively supports TTL on a per-key basis, and can automatically remove expired responses from
the cache. This will be set by by default, according to normal {ref}`expiration settings <expiration>`.
+Expired items are not removed immediately, but will never be returned from the cache. See
+[Redis: EXPIRE](https://redis.io/commands/expire/) docs for more details.
+
If you intend to reuse expired responses, e.g. with {ref}`conditional-requests` or `stale_if_error`,
you can disable this behavior with the `ttl` argument:
```python
diff --git a/docs/user_guide/expiration.md b/docs/user_guide/expiration.md
index d0465f1..a53da87 100644
--- a/docs/user_guide/expiration.md
+++ b/docs/user_guide/expiration.md
@@ -142,15 +142,13 @@ You can also apply a new `expire_after` value to previously cached responses:
>>> session.remove_expired_responses(expire_after=timedelta(days=30))
```
+(ttl)=
### Automatic Removal
The following backends have native TTL support, which can be used to automatically remove expired
responses:
+* {py:mod}`DynamoDB <requests_cache.backends.dynamodb>`
* {py:mod}`MongoDB <requests_cache.backends.mongodb>`
* {py:mod}`Redis <requests_cache.backends.redis>`
-<!--
-TODO: Not yet supported:
-* {py:mod}`DynamoDB <requests_cache.backends.dynamodb>`
--->
## Request Options
In addition to the base arguments for {py:func}`requests.request`, requests-cache adds some extra