# Last-Modified Header — Syntax, Values & Examples

> The date and time the server believes the resource last changed.

Last-Modified gives a timestamp for the resource. Caches revalidate by sending it back in `If-Modified-Since`. When there's no Cache-Control, browsers also use it to guess how long a response stays fresh — commonly 10% of the time since it last changed.

- Type: Response header
- Category: Caching
- Defined in: [RFC 9110 §8.8.2 — Last-Modified](https://www.rfc-editor.org/rfc/rfc9110.html#section-8.8.2)

## Syntax

```http
Last-Modified: <day-name>, <day> <month> <year> <hh>:<mm>:<ss> GMT
```

## Examples

```http
Last-Modified: Wed, 14 Oct 2026 09:30:00 GMT
```

an HTTP date, always in GMT

## Good to know

- Its one-second precision can miss rapid changes — prefer ETag for resources that update often.
- Set Cache-Control explicitly, so heuristic caching doesn't keep old content around.
- The format is fixed; in JavaScript, `new Date().toUTCString()` produces it.

## Who sets Last-Modified

Static file servers set Last-Modified from the file's modification time — nginx, Apache and `express.static` all do it by default. Check it with `curl -sI https://example.com/app.css | grep -i last-modified`.

## Check it

Fetch only the response headers and filter for Last-Modified. In the browser, it's under Response Headers in DevTools → Network.

```sh
curl -sI https://example.com/ | grep -i '^last-modified:'
```

## FAQ

### ETag or Last-Modified?

Send both where you can. ETag is precise and works for generated content; Last-Modified is cheap for static files. When a client sends both conditions, If-None-Match wins.

## Status codes it appears with

- [304 Not Modified](https://www.devkult.com/http/304.md)

## Related headers

- [ETag](https://www.devkult.com/headers/etag.md): An identifier for a specific version of a resource, used to revalidate cached copies and to prevent lost updates.
- [Cache-Control](https://www.devkult.com/headers/cache-control.md): Directives that tell browsers and CDNs whether, where and for how long a response may be cached.
- [If-None-Match](https://www.devkult.com/headers/if-none-match.md): Makes a request conditional: send the resource only if its current ETag isn't one of those listed.

## Further reading

- [HTTP caching explained](https://www.devkult.com/blog/http-caching-explained.md)

Open the interactive page: https://www.devkult.com/headers/last-modified