- Handle errors due to invalid responses in
BaseCache.urls
- Add recently renamed
BaseCache.remove_old_entries()
back, as an alias with a DeprecationWarning - Make parent dirs for new SQLite databases
- Exclude test directory from
find_packages()
See all included issues and PRs
Thanks to Code Shelter and contributors for making this release possible!
Note: Due to the following changes, responses cached with previous versions of requests-cache will be invalid. These old responses will be treated as expired, and will be refreshed the next time they are requested. They can also be manually converted or removed, if needed (see notes below).
- Add example script to convert an existing cache from previous serialization format to new one
- When running
remove_expired_responses()
, also remove responses that are invalid due to updated serialization format - Add
CachedResponse
class to wrap cachedrequests.Response
objects, which makes additional cache information available to client code - Add
CachedHTTPResponse
class to wrapurllib3.response.HTTPResponse
objects, available viaCachedResponse.raw
- Re-construct the raw response on demand to avoid storing extra data in the cache
- Improve emulation of raw request behavior used for iteration, streaming requests, etc.
- Add
BaseCache.urls
property to get all URLs persisted in the cache - Add optional support for
itsdangerous
for more secure serialization
- Cached responses are now stored with an absolute expiration time, so
CachedSession.expire_after
no longer applies retroactively. To revalidate previously cached items with a new expiration time, see below: - Add support for overriding original expiration (i.e., revalidating) in
CachedSession.remove_expired_responses()
- Add support for setting expiration for individual requests
- Add support for setting expiration based on URL glob patterns
- Add support for setting expiration as a
datetime
- Add support for explicitly disabling expiration with
-1
(SinceNone
may be ambiguous in some cases)
- SQLite: Allow passing user paths (
~/path-to-cache
) to database file withdb_path
param - SQLite: Add
timeout
parameter - Make default table names consistent across backends (
'http_cache'
)
- Fix caching requests with data specified in
json
parameter - Fix caching requests with
verify
parameter - Fix duplicate cached responses due to some unhandled variations in URL format
- To support this, the
url-normalize
library has been added to dependencies
- To support this, the
- Fix usage of backend-specific params when used in place of
cache_name
- Fix potential TypeError with
DbPickleDict
initialization - Fix usage of
CachedSession.cache_disabled
if used within another contextmanager - Fix non-thread-safe iteration in
BaseCache
- Fix
get_cache()
,clear()
, andremove_expired_responses()
so they will do nothing if requests-cache is not installed - Update usage of deprecated MongoClient
save()
method - Replace some old bugs with new and different bugs, just to keep life interesting
- Drop support for python <= 3.5
- Add
CacheMixin
class to make the features ofCachedSession
usable as a mixin class, for compatibility with other requests-based libraries. - Add
HEAD
to defaultallowable_methods
- Add type annotations to main functions/methods in public API, and include in documentation on readthedocs
- Add Contributing Guide, Security info, and more examples & detailed usage info in User Guide and Advanced Usage sections.
- Increase test coverage and rewrite most tests using pytest
- Add containerized backends for both local and CI integration testing
- Fix DeprecationWarning from collections #140
- Remove Python 2.6 Testing from travis #133
- Fix DeprecationWarning from collections #131
- vacuum the sqlite database after clearing a table #134
- Fix handling of unpickle errors #128
Project is now added to Code Shelter
- Add gridfs support, thanks to @chengguangnan
- Add dynamodb support, thanks to @ar90n
- Add response filter #104, thanks to @christopher-dG
- Fix bulk_commit #78
- Fix remove_expired_responses missed in init.py #93
- Fix deprecation warnings #122, thanks to mbarkhau
- Support PyMongo3, thanks to @craigls #72
- Fix streaming releate issue #68
- Fix ability to pass backend instance in
install_cache
#61
ignore_parameters
feature, thanks to @themiurgo and @YetAnotherNerd (#52, #55)- More informative message for missing backend dependencies, thanks to @Garrett-R (#60)
- Better transactional handling in sqlite #50, thanks to @rgant
- Compatibility with streaming in requests >= 2.6.x
expire_after
now also acceptstimedelta
, thanks to @femtotrader- Added Ability to include headers to cache key (
include_get_headers
option) - Added string representation for
CachedSession
- Fix bug in reading cached streaming response
- Fix compatibility with Requests > 2.4.1 (json arg, response history)
- Monkey patch now uses class instead lambda (compatibility with rauth)
- Normalize (sort) parameters passed as builtin dict
- Requests==2.3.0 compatibility, thanks to @gwillem
- Check for backend availability in install_cache(), not at the first request
- Default storage fallbacks to memory if
sqlite
is not available
- Fix
response.from_cache
not set in hooks
- Fix
UnpickleableError
for gzip responses
requests_cache.enabled()
context manager- Compatibility with Requests 1.2.3 cookies handling
- Redis backend. Thanks to @michaelbeaumont
- Fix for changes in Requests 1.2.0 hooks dispatching
- Support for
Requests
1.x.x CachedSession
- Many backward incompatible changes
- Fix broken PyPi package
- Last backward compatible version for
Requests
0.14.2
- Thread safety for default
sqlite
backend - Take into account the POST parameters when cache is configured
with 'POST' in
allowable_methods
- Reduce number of
sqlite
database write operations fast_save
option forsqlite
backend
- Fix: restore responses from response.history
- Internal refactoring (
MemoryCache
->BaseCache
,reduce_response
andrestore_response
moved toBaseCache
) connection
option forMongoCache
- initial PyPI release