Doing HTTP Caching Right: Introducing httplib2
by Joe Gregorio
|
Pages: 1, 2, 3, 4
Introducing httplib2
Introducing httplib2, a comprehensive Python HTTP client library that supports a local private cache that understands all the caching operations we just talked about. In addition it supports many features left out of other HTTP libraries.
- HTTP and HTTPS
- HTTPS support is available only if the socket module was compiled with SSL support.
- Keep-Alive
- Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible.
- Authentication
- The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS.
- Caching
- The module can optionally operate with a private cache that understands the
Cache-Control:header and uses both theETagandLast-Modifiedcache validators. - All Methods
- The module can handle any HTTP request method, not just
GETandPOST. - Redirects
- Automatically follows 3XX redirects on
GETs. - Compression
- Handles both
compressandgziptypes of compression. - Lost Update Support
- Automatically adds back
ETags intoPUTrequests to resources we have already cached. This implements Section 3.2 of Detecting the Lost Update Problem Using Unreserved Checkout. - Unit Tested
- A large and growing set of unit tests.
See the httplib2 project page for more details.
Next Time
Next time I will cover HTTP authentication, redirects, keep-alive, and compression in HTTP and how httplib2 handles them. You might also be wondering how the "big guys" handle caching. That will take a whole other article to cover.
- Lockout Services Los Angeles Locksmith 1-310-925-1720
2009-06-30 17:38:56 carpetcare - Cookies
2006-02-16 04:15:03 Stoune2006 - I want one
2006-02-09 07:07:16 Damian Cugley - HTTP Versioning
2006-02-03 16:41:55 Mark Nottingham - Implementations
2006-02-03 14:08:28 Mark Nottingham - Implementations
2006-02-03 17:47:51 Joe Gregorio - Implementations
2006-02-03 20:56:07 Mark Nottingham - Correction
2006-02-02 07:12:42 JimDabell - Correction
2006-02-02 07:22:52 Joe Gregorio