What is an If-Range header?
Used with Range to make a partial-content request conditional, falling back to the full resource if it has changed.
If-Range protects a resumable download from corrupting the file - it tells a website's server to only honour the partial Range request if the resource hasn't changed since the client last saw it, and to send the whole thing fresh otherwise. It matters most for large downloads and video streaming, where resuming a partial fetch against content that's since changed underneath you would silently stitch together two different versions of the file.
Common use case
A download manager resuming an interrupted transfer sends If-Range with the file's original ETag, so if the file was replaced in the meantime the server sends the whole new file instead of a corrupted partial mix.
Example
If-Range: "5d8c72a5edda8c6d0f1a"History
Part of the original HTTP/1.1 specification, RFC 2068 (1997), alongside the Range and Accept-Ranges mechanism.
Did you know?
It can take either an ETag or a Last-Modified date as its value, making it one of the few conditional headers that accepts both validator styles interchangeably.