Update general expiration docs
diff --git a/docs/user_guide/expiration.md b/docs/user_guide/expiration.md index f6a90aa..767b220 100644 --- a/docs/user_guide/expiration.md +++ b/docs/user_guide/expiration.md
@@ -114,12 +114,10 @@ for more details on request errors in general. ## Removing Expired Responses + +### Manual Removal For better read performance, expired responses won't be removed immediately, but will be removed (or replaced) the next time they are requested. -:::{tip} -Implementing one or more cache eviction algorithms is being considered. If this is something you are -interested in, please provide feedback via [issues](https://github.com/reclosedev/requests-cache/issues)! -::: To manually clear all expired responses, use {py:meth}`.CachedSession.remove_expired_responses`: @@ -127,7 +125,7 @@ >>> session.remove_expired_responses() ``` -Or, when using patching: +Or, if you are using {py:func}`.install_cache`: ```python >>> requests_cache.remove_expired_responses() ``` @@ -137,6 +135,16 @@ >>> session.remove_expired_responses(expire_after=timedelta(days=30)) ``` +### Automatic Removal +The following backends have native TTL support, which can be used to automatically remove expired +responses: +* {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 cache-related arguments. These apply to {py:meth}`.CachedSession.request`,
diff --git a/requests_cache/backends/dynamodb.py b/requests_cache/backends/dynamodb.py index 711022e..2ec971a 100644 --- a/requests_cache/backends/dynamodb.py +++ b/requests_cache/backends/dynamodb.py
@@ -16,6 +16,8 @@ DynamoDB binary item sizes are limited to 400KB. If you need to cache larger responses, consider using a different backend. + + Creating Tables ^^^^^^^^^^^^^^^ Tables will be automatically created if they don't already exist. This is convienient if you just
diff --git a/requests_cache/patcher.py b/requests_cache/patcher.py index 5678b7f..dd81f67 100644 --- a/requests_cache/patcher.py +++ b/requests_cache/patcher.py
@@ -1,4 +1,4 @@ -"""Utilities for patching ``requests``. +"""Utilities for patching ``requests``. See :ref:`patching` for general usage info. .. warning:: These functions are not thread-safe. Use :py:class:`.CachedSession` if you want to use caching in a multi-threaded environment.