summaryrefslogtreecommitdiff
path: root/docs/user_guide
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-02-24 11:16:57 -0600
committerJordan Cook <jordan.cook@pioneer.com>2022-02-24 11:16:57 -0600
commit1e841361e8183cf5cac44650e69d4f670252767e (patch)
tree1120f8775727afcd5c984be1f9a0efdec524ad47 /docs/user_guide
parentcc5305f6f9f206b3be5f6a61c2a56e8c2418718b (diff)
downloadrequests-cache-1e841361e8183cf5cac44650e69d4f670252767e.tar.gz
Change wording a bit on cache header behavior
Diffstat (limited to 'docs/user_guide')
-rw-r--r--docs/user_guide/headers.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/user_guide/headers.md b/docs/user_guide/headers.md
index 9fdfb8e..f4ad18d 100644
--- a/docs/user_guide/headers.md
+++ b/docs/user_guide/headers.md
@@ -32,12 +32,11 @@ True, True
```
## Cache-Control
-`Cache-Control` **request** headers will be used if present. This is mainly useful for patching an
-existing library that sets request headers.
+`Cache-Control` **request** headers will always be used if present. This is mainly useful if you are
+adding requests-cache to an existing application or library that already uses caching request headers.
`Cache-Control` **response** headers are an opt-in feature. If enabled, these will take priority over
any other `expire_after` values. See {ref}`precedence` for the full order of precedence.
-
To enable this behavior, use the `cache_control` option:
```python
>>> session = CachedSession(cache_control=True)
@@ -48,15 +47,15 @@ The following headers are currently supported:
**Request headers:**
- `Cache-Control: max-age`: Used as the expiration time in seconds
-- `Cache-Control: no-cache`: Skips reading response data from the cache
-- `Cache-Control: no-store`: Skips reading and writing response data from/to the cache
+- `Cache-Control: no-cache`: Skip reading from the cache
+- `Cache-Control: no-store`: Skip reading from and writing to the cache
- `If-None-Match`: Automatically added if an `ETag` is available
- `If-Modified-Since`: Automatically added if `Last-Modified` is available
**Response headers:**
- `Cache-Control: max-age`: Used as the expiration time in seconds
-- `Cache-Control: no-store` Skips writing response data to the cache
-- `Cache-Control: immutable`: Caches the response with no expiration
+- `Cache-Control: no-store` Skip writing to the cache
+- `Cache-Control: immutable`: Cache the response with no expiration
- `Expires`: Used as an absolute expiration time
-- `ETag`: Returns expired cache data if the remote content has not changed (`304 Not Modified` response)
-- `Last-Modified`: Returns expired cache data if the remote content has not changed (`304 Not Modified` response)
+- `ETag`: Return expired cache data if the remote content has not changed (`304 Not Modified` response)
+- `Last-Modified`: Return expired cache data if the remote content has not changed (`304 Not Modified` response)