HTTP Instance Digests and encoding

Hi,

We’ve been looking at HTTP Instance Digest as defined in RFC 3230. The document seems to skim over a detail that is causing us some internal debate when considering compression like gzip. The question boils down to whether a digest should be calculated on the pre-compressed object or post-compressed one.

Section 4.2 states:

The digest is computed on the entire instance associated with the message. The instance is a snapshot of the resource prior to the application of any instance manipulation or transfer-coding (see section 3). The byte order used to compute the digest is the transmission byte order defined for the content-type of the instance.

Note: the digest is computed before the application of any instance manipulation. If a range or a delta-coding [9] is used, the computation of the digest after the computation of the range or delta would not provide a digest useful for checking the integrity of the reassembled instance.

Section 3 defines the relevant items:

   instance          The entity that would be returned in a status-200
                     response to a GET request, at the current time, for
                     the selected variant of the specified resource,
                     with the application of zero or more content-
                     codings, but without the application of any
                     instance manipulations or transfer-codings.


   instance manipulation

                     An operation on one or more instances which may

                     result in an instance being conveyed from server to

                     client in parts, or in more than one response

                     message.  For example, a range selection or a delta

                     encoding.  Instance manipulations are end-to-end,

                     and often involve the use of a cache at the client.

In our usage, resources are compresses with gzip and have an accompanying Content-encoding: gzip response header. Treating this as an instance manipulation is beneficial, because we allows a server to precompute the digest independent of the format of the compression used to deliver the resource.

Kind regards
Lucas



----------------------------

http://www.bbc.co.uk

This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.

---------------------

Received on Wednesday, 16 May 2018 10:25:24 UTC