subbu.org

HTTP, REST and some Cycling

POST Caching Example

with one comment

Here is a good example of caching of POST responses by Henrik Nordström in the HTTP WG.

The classic example of where a cacheable response to POST makes sense is the guestbook example (or unmoderated blog comments for those needing a more modern example, basically the same thing in a different era) where the visitor POSTs an addition to the page currently viewed, or “separate entity that accepts annotations” as it’s expressed in the RFC. The response given to the POST is the new representation of the page. Both
GET and POST uses the same URL in this example.

followed by

Note that the POST request as such can never be satisfied from cache. A repeated POST with the same form content will not yield the same result even if the response is cacheable.

The context of this thread was whether the HTTP method should be included in the cache key. See this thread for a complete summary.

Written by subbu

November 18th, 2008 at 2:25 pm

Posted in HTTP

Tagged with

One Response to 'POST Caching Example'

Subscribe to comments with RSS or TrackBack to 'POST Caching Example'.

  1. nice post

    [Reply]

    Clay

    20 Jan 09 at 8:55 pm

Leave a Reply