226 IM Used: Instance Manipulations and Delta Encoding
A-IM (Accept-Instance-Manipulation) header to request delta‑encoded responses (e.g., diff, patch, gzip) rather than the full resource. This reduces bandwidth and improves performance for clients that already have a previous version.
How 226 IM Used Works
The client sends a GET request with an A-IM header listing accepted instance manipulations, for example:
If the server has a previous version of the resource and can generate a diff, it responds with 226 IM Used, includes an IM (Instance-Manipulation) header indicating which manipulation was applied, and returns the manipulated representation (e.g., the diff) in the body.
Common Instance Manipulations
- diff – returns the changes between the client's version and the current version (delta encoding).
- patch – returns a patch that can be applied to the client's version.
- gzip – returns the resource compressed with gzip.
- vcdiff – uses the VCDIFF format for delta compression.
- deflate – returns the resource compressed with deflate.
Example Flow with Delta Encoding
| Step | Direction | HTTP Message |
|---|---|---|
| 1 | Client (has version 1) | GET /document.txt HTTP/1.1 |
| 2 | Server (current version 2) | Generates diff between v1 and v2. |
| 3 | Server → Client | HTTP/1.1 226 IM Used |
| 4 | Client | Applies diff to local version, now has version 2. |
Benefits of 226 IM Used
- Bandwidth savings – transmitting only changes, not the entire resource.
- Reduced latency – smaller payloads mean faster transmission.
- Efficient synchronization – ideal for scenarios where clients frequently fetch updates (e.g., large datasets, versioned content).
Comparison with 200 OK
| Status | Response Content | Use Case |
|---|---|---|
| 200 OK | Full representation of the resource | Client does not have any version, or server cannot generate a diff. |
| 226 IM Used | Manipulated representation (diff, patch, compressed) | Client has a previous version and requests delta updates. |
When Not to Use 226
- If the client doesn't request instance manipulation – respond with 200 OK.
- If the server cannot generate the requested manipulation – either ignore the
A-IMheader and return 200, or respond with 501 Not Implemented if the manipulation method is unsupported. - If the resource has not changed – respond with 304 Not Modified (if
If-None-MatchorIf-Modified-Sincematches).
Frequently Asked Questions
Is 226 IM Used widely supported?
It is a relatively obscure status code, supported by some HTTP libraries and servers, but not as common as 200 or 304. Its primary use is in systems that implement delta encoding (like some version control systems, distributed databases, or CDN edge caches).
What headers are required for 226?
The response must include an IM header indicating the instance manipulation applied (e.g., IM: diff). Optionally, ETag can be sent to identify the new version. The Content-Type should reflect the format of the manipulated data.
Can I use 226 with POST or PUT?
226 is defined only for GET requests. For other methods, the server should use the appropriate status code (e.g., 201, 204, 200).