Sign In/My Account | View Cart  
advertisement

Article:
 Doing HTTP Caching Right: Introducing httplib2
Subject: Implementations
Date: 2006-02-03 14:08:28
From: Mark Nottingham

Nice article, Joe!


One thing to keep in mind is that the level of support for these mechanisms varies. While Last-Modified validators are supported by pretty much every cache, ETags aren't; last time I looked, most of the big Web proxy caches didn't use them. A similar story can be seen on the client side.


Similarly, Vary headers can act like cache-busters; in my testing (which was admittedly a while ago), not a single widely-used Web cache would store a representation with a Vary header; they treated it as a no-store.


Finallly, don't always assume your server will handle caching or other protocol functions for you; they often don't. See: http://www.mnot.net/papers/capabilities.html (also old; I really need to do another round of testing).


httplib2 looks exciting; I'll definately have a play. One of the biggest problems that I see out there is tool support; there just aren't many good server-side or client-side tools that support RESTful applications.


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Implementations
    2006-02-03 17:47:51 Joe Gregorio

    Mark,
    I've tried to be as careful as I could in my implementation. For example, I will use all validators that a server sends; if it sends just an ETag I use that, if a server sends just Last-Modified I use that, if a server sends both then I will send back both when validating. Httplib2 also adds in a "Cache-Control: no-cache" header if a request is sent with "Pragma: no-cache".
    Vary headers can be a problem for intermediaries, but I don't think there is anything much I can do about that as a client library.




    • Implementations
      2006-02-03 20:56:07 Mark Nottingham

      That's great; I wouldn't think you'd do a bad job; just pointing out that people shouldn't have very high expectations for other implementations.


      Cheers,


Sponsored By: