kwvanderlinde / python-cached-requests Goto Github PK
View Code? Open in Web Editor NEWMemory-efficient caching for the requests library and Python 3
License: BSD 3-Clause "New" or "Revised" License
Memory-efficient caching for the requests library and Python 3
License: BSD 3-Clause "New" or "Revised" License
The current implementation is not aware of ETag at all, though it naturally stores ETag along with the rest of the headers. The CachedHTTPAdapter
should be updated to add an If-None-Match
to requests when the current cache entry is stale.
Note that the Cache
interface is not sufficient for caches to implement time-based expiry, especially when combined with the desire to use the ETag to validate a stale entry. This is deliberate, as caches should not be altering requests, which is necessary with ETag. Instead, the adapter will check whether the CacheEntry
returned by a cache is stale or not, and use the ETag if it is present.
Another option is to enhance the Cache
interface. We could add a stale
member to CacheEntry
to indicate whether the entry is stale or not, as determined by the cache implementation. It would still be up to the adapter to make use of this information properly, and to delete any invalidated entries.
The current state of logging is awful. In some places, we simply print(...)
messages, which is unacceptable for a library to do. Elsewhere, we simply have # TODO ...
comments instructing us to log certain cases. In other places yet, we have comments that could be replaced with INFO
logs that provide the same value, but can produce output on execution.
The HttpAwareCache
is missing some crucial parts. In particular, Cache-Control
is not processed at all. We should rectify this with an implementation that respects Cache-Control
.
When dealing with headers in the cache and adaptor, we do not respect the case-insensitive nature of header names. We should use a strategy that permits proper lookup of header values regardless of case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.