XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

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 the ETag and Last-Modified cache validators.
All Methods
The module can handle any HTTP request method, not just GET and POST.
Redirects
Automatically follows 3XX redirects on GETs.
Compression
Handles both compress and gzip types of compression.
Lost Update Support
Automatically adds back ETags into PUT requests 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.



1 to 6 of 6
  1. Lockout Services Los Angeles Locksmith 1-310-925-1720
    2009-06-30 17:38:56 carpetcare
  2. Cookies
    2006-02-16 04:15:03 Stoune2006
  3. I want one
    2006-02-09 07:07:16 Damian Cugley
  4. HTTP Versioning
    2006-02-03 16:41:55 Mark Nottingham
  5. Implementations
    2006-02-03 14:08:28 Mark Nottingham
  6. Correction
    2006-02-02 07:12:42 JimDabell
1 to 6 of 6