Re: RFC7234: Can a request body form part of a "cache key"?

On 27 Jul 2016, at 7:13 PM, Roy T. Fielding <fielding@gbiv.com> wrote:

>> Could an RFC7234 compliant cache use a request body as part of the cache key, if it was so defined for a particular method?
> 
> Yes.
> 
>> Concrete example: If a cache cached a PROPFIND request keyed against a request body and URL, would that be RFC7234 compliant? Same for a SEARCH request?
> 
> Yes (assuming the PROPFIND response is marked cacheable) and Yes (ditto).
> The problem is ensuring that the body is sufficiently limited so that it
> won't be unique per request.
> 
> Caches that do not support this kind of caching should simply pass the
> request/response through unharmed. Actual mileage may vary.

What would be a reasonable way to configure a RFC7234 compliant cache that wants to cache methods other than GET?

Would it be reasonable to explicitly specify the methods the cache is willing to cache, and have “GET” as the default? for example:

  CacheMethods GET PROPFIND SEARCH

What happens if the cache is misconfigured by the admin to cache something that is marked uncacheable by an RFC, for example:

  CacheMethods PUT DELETE

Would an RFC7234 compliant cache explicitly fail such a configuration?

Regards,
Graham
—

Received on Thursday, 28 July 2016 16:20:48 UTC