Idempotent POSTs

    But what happens if a PUT is done through an intermediary?  Are you
    saying that the PUT is only passed through if the proxy's validator
    matches the request's validator?  I don't think that works.  If the
    cache has been updated since the client's original GET, or if the
    client switched to using a proxy that had a version prior to the
    one it GOT, the GOTten validator won't match the cache's
    validator.  In case of either a match or non-match, the cache must
    pass the request through.

I agree.  Idempotent (conditional) PUTs/POSTs etc. would have to be
passed all the way to the origin server, for two reasons:

(1) I don't think it is possible to do "write-back" caching in HTTP.
It's extremely difficult to get the right failure semantics for
this.  (I can elaborate if people insist.)  Instead, we have to
do "write-through" caching (all writes are immediately transmitted
to the origin server).  We may need to debate whether we do
"write-through-and-invalidate", although that's a separate issue.

Anyway, what this means is that all *successful* POSTs have to go
all the way to the origin server.

(2) Since a cache cannot know if the server's cache-validator has
changed as the result of a write via some other path, it cannot
properly implement a conditional POST itself (I'm assuming that for
writable resources, the server assigns a very short or zero Fresh-until
timeout)  This means that it would at least have to send some sort of
validation check all the way to the origin server.  We might as well
just send the entire PUT.  If the conditional fails, this could waste
some bandwidth (transmitting the first few windows of data), but
not a lot of bandwidth, and it's simple enough to implement.

    If we adopted the mandatory use of cache-control:no-cache on
    requests to signify they must go through to the origin server, the
    omission of that header would imply that if a cache contained a
    fresh copy of the response, then the method would not have to be
    passed through.  I am assuming here, in the case of POST, for
    instance, that the cache would have to match the entity in the POST
    request to know if the appropriate result was present in the cache
    (this could get messy, maybe enough to render this whole discussion
    moot, but that's irrelevant for the moment).

Are you really suggesting here that a cache could respond to a POST
locally, without writing it through to the origin server?  This does
indeed get messy!

    Also, I'd like to suggest we stay away from the word "idempotence"
    which has caused much trouble in the past in this group.

Why?  It's a perfectly good word, with a well-understood and
well-defined meaning among the distributed-systems community.

-Jeff

Received on Thursday, 4 January 1996 19:36:45 UTC