devkult_
tools29converters34
home/headers/if-modified-since

If-Modified-Since

request headercaching

Asks the server to send the resource only if it changed after the given date — otherwise a 304.

When a cached response carries Last-Modified, the browser revalidates by sending that date back in If-Modified-Since. If the resource hasn't changed since, the server answers 304 Not Modified with no body. When a request carries both If-None-Match and If-Modified-Since, servers use the ETag and ignore the date.

Syntax

If-Modified-Since: <day-name>, <day> <month> <year> <hh>:<mm>:<ss> GMT

Defined in RFC 9110 §13.1.3 — If-Modified-Since.

Examples

If-Modified-Since: Wed, 14 Oct 2026 09:30:00 GMT

the Last-Modified value from the cached response

Good to know

  • Dates have one-second resolution, so two changes within a second can be missed — ETags don't have that problem.
  • Only meaningful for GET and HEAD.
  • The date must be in GMT, in the HTTP date format.

Further reading: HTTP caching explained

Who sets If-Modified-Since

Browsers send If-Modified-Since on their own when revalidating a cached response that had Last-Modified. To test, copy the date from a response and send it back: curl -sI -H 'If-Modified-Since: Wed, 14 Oct 2026 09:30:00 GMT' https://example.com/app.css — an unchanged file returns 304.

Check it

In the browser, open DevTools → Network, pick a request and look under Request Headers. From the command line, curl's verbose mode prints every header it sends, prefixed with >:

curl -sv https://example.com/ -o /dev/null 2>&1 | grep '^>'

Frequently asked questions

Should I use ETag or Last-Modified?

Send both if you can. ETags are more precise; Last-Modified is easy to produce for files and also feeds browsers' heuristic caching.

Status codes it appears with
Related headers