diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2022-05-03 14:52:37 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-05-03 14:52:37 -0500 |
commit | 7f4c20525770d463c5526fa601e8e3b5472cf2e6 (patch) | |
tree | 98bf214cb4ad9395f136a6a93010f0ada54e3a20 /docs | |
parent | a300510c4ba087fd41d31c379a9d03e3b80b55aa (diff) | |
download | requests-cache-7f4c20525770d463c5526fa601e8e3b5472cf2e6.tar.gz |
Add always_revalidate session option
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user_guide/expiration.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/user_guide/expiration.md b/docs/user_guide/expiration.md index a53da87..3257571 100644 --- a/docs/user_guide/expiration.md +++ b/docs/user_guide/expiration.md @@ -181,6 +181,15 @@ Example: >>> assert response_2.from_cache is False ``` +### Validation-Only Requests +If you want to always send a conditional request before using a cached response, you can use the +session setting `always_revalidate`: +```python +>>> session = CachedSession(always_revalidate=True) +``` + +Unlike the `refresh` option, this only affects cached responses with a validator. + ### Cache-Only Requests If you want to only use cached responses without making any real requests, you can use the `only_if_cached` option. This essentially uses your cache in "offline mode". If a response isn't |