If-Unmodified-Since: a date based conditional write
If-Unmodified-Since performs the request only if the resource has not changed since the given date. If it has, the server answers 412 Precondition Failed and does nothing.
At a glance
- Direction
- Request only, most often on a write or a delete.
- Defined in
- RFC 9110
- When absent
- The write is unconditional, so a concurrent change is overwritten with no warning.
- Result on failure
- 412 Precondition Failed, with the resource untouched
- Ignored when
- If-Match is present, which takes precedence
- Resolution
- One second, so two writes in the same second can both appear valid
- Also used with
- Range requests, to abort a partial download when the file changed
In detail
This is the date equivalent of If-Match, for servers and clients that track modification times rather than versions. The client says it last saw the resource at this timestamp and asks the server to proceed only if nothing has been written since. A newer modification time means somebody else got there first, and the answer is 412 with no change applied.
It is weaker than If-Match for the same reason If-Modified-Since is weaker than If-None-Match: one second of resolution. Two writes landing inside the same second look identical to the check, so a busy record can pass the condition while genuinely having changed. For anything where a lost update matters, an entity tag is the correct tool.
Where both headers appear, If-Match wins and the date is ignored. That mirrors the read side rule and exists for the same reason: when a client offers both a precise validator and an imprecise one, the server must decide on the precise one rather than picking whichever is convenient.
There is a second use on reads. A client resuming a partial download can send this header alongside a Range request so that, if the file changed while it was away, it receives a fresh 200 or a 412 instead of stitching new bytes onto an old prefix and producing a corrupted file.
Examples
DELETE /uploads/report.pdf HTTP/1.1
If-Unmodified-Since: Fri, 10 Jan 2025 09:00:00 GMT
HTTP/1.1 412 Precondition FailedGET /files/archive.zip HTTP/1.1
Range: bytes=1048576-
If-Unmodified-Since: Fri, 10 Jan 2025 09:00:00 GMTIf the file changed, the server answers 412 rather than sending bytes that do not belong to the copy already on disk.
Things that catch people out
- One second resolution makes this unsafe for records updated frequently. Use If-Match with a strong ETag when a lost update would matter.
- A server whose clock is ahead of the client's can reject writes that should have succeeded, which shows up as intermittent 412 responses under load.
- It is ignored entirely when If-Match is also present, so sending both and expecting the date to add safety is a mistake.
Try it: HTTP Headers Checker
Check a live URL or paste headers you already have. It grades six security headers from A+ to F and lists every other header the response returned.
HTTP Headers Checker
LOCAL · Browser-OnlyView HTTP response headers for any URL
Enter any website URL to fetch and analyze its HTTP response headers. We'll automatically add https:// if needed.
Why Check Security Headers?
Security headers protect your website against common attacks like XSS, clickjacking, and MIME sniffing. They're set by your web server and cost nothing to implement. Missing security headers are one of the most common findings in security audits.
Related HTTP headers
All http headers →If-Match: safe updates and the lost update problem
How If-Match turns a PUT or PATCH into a conditional write, why it uses strong comparison, and how 412 Precondition Failed prevents silent overwrites.
If-Modified-Since: date based conditional requests
How If-Modified-Since produces a 304, why it only applies to GET and HEAD, when servers must ignore it, and why entity tags are preferred where both exist.
Last-Modified: timestamps as a weak validator
The exact date format Last-Modified requires, why one second resolution makes it a weak validator, and how caches use it to guess freshness.
Range: asking for part of a resource
How to request a byte range, what a suffix range does, why a server may ignore the header and return 200, and how to resume a download safely.
Pragma: a deprecated header still copied everywhere
What Pragma: no-cache ever did, why it only applied to requests, why it is deprecated in RFC 9111, and whether there is any reason to keep sending it.
Date: when the response was generated
What the Date header records, the exact GMT format required, how caches use it with Age and max-age, and the one case where a server may omit it.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL