summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-09-07 14:06:37 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-09-07 14:35:03 -0500
commit5779131b4cb62a3a513285f8fba0c675db07ae66 (patch)
treeb821a3ff8c1b805e8ec010bf9c02a58288321fce /README.md
parent310bab8047c714ee190b0eb8ac36838af1711308 (diff)
downloadrequests-cache-5779131b4cb62a3a513285f8fba0c675db07ae66.tar.gz
Update changelog and Readme linksv0.8.0
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 13 insertions, 12 deletions
diff --git a/README.md b/README.md
index d95a7e4..4c04af1 100644
--- a/README.md
+++ b/README.md
@@ -19,26 +19,26 @@ Complete project documentation can be found at [requests-cache.readthedocs.io](h
## Features
* 🍰 **Ease of use:** Keep using the `requests` library you're already familiar with. Add caching
- with a [drop-in replacement](https://requests-cache.readthedocs.io/en/stable/api.html#sessions)
+ with a [drop-in replacement](https://requests-cache.readthedocs.io/en/stable/user_guide/general.html#sessions)
for `requests.Session`, or
- [install globally](https://requests-cache.readthedocs.io/en/stable/user_guide.html#patching)
+ [install globally](https://requests-cache.readthedocs.io/en/stable/user_guide/general.html#patching)
to add caching to all `requests` functions.
* 🚀 **Performance:** Get sub-millisecond response times for cached responses. When they expire, you
still save time with
- [conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests).
+ [conditional requests](https://requests-cache.readthedocs.io/en/stable/user_guide/headers.html#conditional-requests).
* 💾 **Persistence:** Works with several
- [storage backends](https://requests-cache.readthedocs.io/en/stable/user_guide.html#cache-backends)
+ [storage backends](https://requests-cache.readthedocs.io/en/stable/user_guide/backends.html)
including SQLite, Redis, MongoDB, and DynamoDB; or save responses as plain JSON files, YAML,
and more
* ⚙️ **Customization:** Works out of the box with zero config, but with a robust set of features for
configuring and extending the library to suit your needs
* 🕗 **Expiration:** Keep your cache fresh using
- [Cache-Control](https://requests-cache.readthedocs.io/en/stable/user_guide.html#cache-control),
+ [Cache-Control](https://requests-cache.readthedocs.io/en/stable/user_guide/headers.html#cache-control),
eagerly cache everything for long-term storage, use
- [URL patterns](https://requests-cache.readthedocs.io/en/stable/user_guide.html#url-patterns)
+ [URL patterns](https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#expiration-with-url-patterns)
for selective caching, or any combination of strategies
* ✔️ **Compatibility:** Can be combined with other popular
- [libraries based on requests](https://requests-cache.readthedocs.io/en/stable/advanced_usage.html#library-compatibility)
+ [libraries based on requests](https://requests-cache.readthedocs.io/en/stable/user_guide/compatibility.html)
## Quickstart
First, install with pip:
@@ -46,7 +46,7 @@ First, install with pip:
pip install requests-cache
```
-Then, use [requests_cache.CachedSession](https://requests-cache.readthedocs.io/en/stable/api.html#sessions)
+Then, use [requests_cache.CachedSession](https://requests-cache.readthedocs.io/en/stable/session.html)
to make your requests. It behaves like a normal
[requests.Session](https://docs.python-requests.org/en/master/user/advanced/#session-objects),
but with caching behavior.
@@ -92,16 +92,17 @@ requests.get('http://httpbin.org/delay/1')
A quick example of some of the options available:
```python
+# fmt: off
from datetime import timedelta
from requests_cache import CachedSession
session = CachedSession(
'demo_cache',
- use_cache_dir=True # Save files in the default user cache dir
+ use_cache_dir=True, # Save files in the default user cache dir
cache_control=True, # Use Cache-Control headers for expiration, if available
expire_after=timedelta(days=1), # Otherwise expire responses after one day
- allowable_methods=['GET', 'POST'] # Cache POST requests to avoid sending the same data twice
- allowable_codes=[200, 400] # Cache 400 responses as a solemn reminder of your failures
+ allowable_methods=['GET', 'POST'], # Cache POST requests to avoid sending the same data twice
+ allowable_codes=[200, 400], # Cache 400 responses as a solemn reminder of your failures
ignored_parameters=['api_key'], # Don't match this param or save it in the cache
match_headers=True, # Match all request headers
stale_if_error=True, # In case of request errors, use stale cache data if possible
@@ -114,7 +115,7 @@ To find out more about what you can do with requests-cache, see:
* [User Guide](https://requests-cache.readthedocs.io/en/stable/user_guide.html)
* [API Reference](https://requests-cache.readthedocs.io/en/stable/reference.html)
-* [Project Info](https://requests-cache.readthedocs.io/en/latest/project_info.html)
+* [Project Info](https://requests-cache.readthedocs.io/en/stable/project_info.html)
* A working example at Real Python:
[Caching External API Requests](https://realpython.com/blog/python/caching-external-api-requests)
* More examples in the