| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Closes #243
|
| |
|
|
| |
of items
|
| |
|
|
| |
avoid deleting redirects.sqlite with clear()
|
| |
|
|
| |
rather than BaseCache class
|
| | |
|
| | |
|
| |\
| |
| | |
Use thread local connections for sqlite
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
| |
test for this
|
| |
|
|
|
|
|
|
| |
* Pass `**kwargs` to backend storage classes, split out any that are valid for the backend-specific connection function/class, and pass them to the connection
* Add intersphinx links to docs for dependencies
* Update and format some more backend class docstrings
* Remove 'Unrecognized keyword arguments' warning from `BaseStorage`
* Turn `warnings.warn` about using secret keys into a `logging.warning` (due to complaints about too many messages)
|
| |
|
|
| |
Updates #98
|
| | |
|
| |
|
|
|
|
|
| |
kwargs in BaseStorage
Also don't name them as private members, since they can safely by
changed after initialization (e.g., `session.cache.include_get_headers = True`)
|
| | |
|
| | |
|
| |
|
|
| |
rarther than silently ignoring or hanging
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use sphinx-apidoc to auto-generate sources for backend modules
* Still manually adding other modules for more control over formatting
* Add a couple more contributors I missed
* Include contributors on readthedocs
* Add 'all' Makefile target and clean auto-generated docs
* Remove unused build targets in Makefile
* Update interpshinx links that have moved
* Fix some interpshinx links
* Fix some `:ref:` links using auto-generated labels (and some manually added labels where convenient)
* Fix some docstring formatting
* Fix remaining build warnings
|
| |
|
|
|
|
|
| |
* Also allow passing a backend class (in addition to backend name and instance)
* Detect duplicate params: Backends have different keyword args equivalent to the `cache_name` positional arg, for example `db_name`. If one of these is passed as a keyword arg, it results in a `TypeError` due to duplicate args (See #94).
* For backends without dependencies installed, use a placeholder class to delay and re-raise the original `ImportError`
* Add type annotations
|
| |
|
|
| |
Closes #209
|
| |
|
|
| |
cache key
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
names consistent across backends (`'http_cache'`)
|
| |
|
|
| |
docker-compose; use in-memory database
|
| |
|
|
| |
backends in backends.*
|
| | |
|
| | |
|
| |
|
|
| |
Closes #155
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
into CachedResponse class:
* Replace `_RawStore` with `CachedHTTPResponse` class to wrap raw responses
* Maintain support for streaming requests (#68)
* Improve handling for generator usage
* Add support for use with `pandas.read_csv()` and similar readers (#148)
* Add support for use as a context manager (#148)
* Add support for `decode_content` arg
* Fix streaming requests when used with memory backend (#188)
* Verified that `PreparedRequest.body` is always encoded in utf-8, so no need to detect encoding (Re: TODO note)
* Response creation time and expiration time are stored as CachedResponse, so the `(response, timestamp)` tuple is no longer necessary
* Rename `response.expire_after` and `response.cache_date` to `expires` and `created_at`, respectively, based on browser cache directives
* Add optional `expire_after` param to `CachedSession.remove_old_responses()`
* Make `CachedSession` members `allowable_codes, allowable_methods, filter_fn, old_data_on_error`
public, since they can safely be modified after initialization
* More type annotations and docstring updates
* Move main cache documentation from `CacheMixin` to CachedSession`, since that's probably where a user would look first
* Wrap temporary `_request_expire_after` in a contextmanager
* Add intersphinx links for `urllib` classes & methods
* Fix linting issues raised by flake8
* Start adding some unit tests using requests-mock
tmp
|
| |
|
|
|
|
|
|
|
| |
* Pass per-request expiration in request params instead of setting as a temporary instance variable
* Make use of dict ordering from python3.6+ in _normalize_parameters()
* Add some more type annotations to `CachedSession` methods
* Remove `expires_before` param from remove_old_entries, and always use the current time
* Remove `relative_to` param from `CachedSession._determine_expiration_datetime` and use mock values
in unit tests instead
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add individual expire_after per request.
This commit adds a new feature to allow individual expire_after times
per request.
It involves using a custom CachedSession, PerRequestCachedSession,
to be used as the session_factory.
* Replace deprecated asserts in unit tests
Additionally, some sockets are closed even on test failures.
This removes some visual clutter when going through the results.
* Update docs and README for per-request caching
* Remove per_request and integrate behavior into CachedSession
* Make test_return_old_data_on_error more reliable
This is achieved by using a fixed date and mocking the backend calls to datetime as well.
* Adjust per_request cache to new behavior
Also adds HTTPBIN_URL environment variable as in test_cache
* Add tests for the function determining the expiration datetime
* Adjust backend to store expiration dates
This also involves slightly different semantics for deletion, but the behavior stays the same.
* Minor: black and isort
* Update docs for request
Add explanation for expire_after special cases, i.e. 'default' and 'cached' and how precedences are handled
* Replace assert statements with methods
* Remove invalid snippet from README
* Remove invalid sentence from docs.
* Make expires_before timezone-aware once
And combine the checks for expiration
* Simplify complexity by removing 'cached' keyword for expire_after
|
| |
|
|
| |
sure CachedSession is installed
|
| | |
|