A-IM
Delta encoding reduces bandwidth by transferring only the differences between resource versions. The A-IM request header lists the instance manipulations a client accepts for this process.
Usage
The A-IM header is part of the delta encoding mechanism. Instead of transferring a full resource on every request, a server sends only the differences (a delta) between the version the client already has and the current version. The A-IM header tells the server which delta algorithms the client understands.
A client pairs A-IM with standard conditional request headers like If-None-Match to identify the cached version. When the server has a matching base version and supports one of the listed algorithms, the response carries a 226 IM Used status code. The IM response header confirms which algorithm was applied, and the Delta-Base header identifies the base version the delta is computed against.
Quality values rank the preferred algorithms when multiple options are listed. The server selects the highest-ranked algorithm available.
Values
vcdiff
VCDIFF format, a binary delta encoding. Efficient for transferring changes between versions of binary or text resources.
diffe
A diff-based encoding producing ed script output
(the format of diff -e). Ed scripts use a, c,
and d commands to describe line-level changes.
Suited for text resources where changes are
line-oriented.
gdiff
GDIFF format, a generic binary delta encoding based on the W3C GDIFF submission. An alternative to VCDIFF for binary differencing.
gzip
Standard gzip compression applied to the delta. Often combined with another instance manipulation.
deflate
Zlib deflate compression applied to the delta. Like gzip, often combined with another instance manipulation.
range
Selects a byte range as an instance manipulation.
Combines delta encoding with partial responses. The
position of range in the list matters: listed last,
the range applies to the output of the other instance
manipulations.
identity
No transformation applied. The value is meaningful only in A-IM, where it signals a plain full response remains acceptable.
;q= (quality value)
A weight between 0 and 1 expressing relative
preference among the listed algorithms. The default
is 1.0.
Example
A client indicating support for VCDIFF delta encoding
with gzip as a lower-priority alternative. The quality
value 0.4 on gzip signals a preference for VCDIFF.
A-IM: vcdiff, gzip;q=0.4
A full request combining A-IM with conditional headers. The client sends an ETag from a previous response and requests a delta update.
GET /data.json HTTP/1.1
Host: api.example.re
If-None-Match: "abc123"
A-IM: vcdiff
The server responds with 226 IM Used, the applied algorithm in IM, and the base version reference in Delta-Base.
HTTP/1.1 226 IM Used
ETag: "def456"
IM: vcdiff
Delta-Base: "abc123"