summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-05-03 15:11:54 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-05-03 19:58:28 -0500
commit375e611e50b7d2780e8d7007455b48453c9ba4b3 (patch)
treed05ca25bfd5a633170812ecd5282b7a0f690cd27 /docs
parent7f4c20525770d463c5526fa601e8e3b5472cf2e6 (diff)
downloadrequests-cache-375e611e50b7d2780e8d7007455b48453c9ba4b3.tar.gz
Add 'older_than' argument to remove_expired_responses()
Diffstat (limited to 'docs')
-rw-r--r--docs/user_guide/expiration.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/user_guide/expiration.md b/docs/user_guide/expiration.md
index 3257571..ab79b24 100644
--- a/docs/user_guide/expiration.md
+++ b/docs/user_guide/expiration.md
@@ -137,8 +137,15 @@ Or, if you are using {py:func}`.install_cache`:
>>> requests_cache.remove_expired_responses()
```
-You can also apply a new `expire_after` value to previously cached responses:
+You can also remove responses older than a certain time:
```python
+# Remove expired responses *and* responses older than 7 days
+remove_expired_responses(older_than=timedelta(days=7))
+```
+
+Or apply a new expiration value to previously cached responses:
+```python
+# Reset expiration for all responses to 30 days from now
>>> session.remove_expired_responses(expire_after=timedelta(days=30))
```