---
source: https://iinventedlight.com/library/notes/http-etag-if-none-match.md
title: "Answer conditional GET with ETag and If-None-Match"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Django docs); CC-BY-4.0 (WHATWG); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Django docs, Conditional View Processing; WHATWG, Fetch Standard. BSD-3-Clause; CC-BY-4.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: HTTP ETag and If-None-Match conditional requests"
tags: [http, etag, if-none-match, conditional, django, 304]
client: Librarian
sources:
  - id: S1
    title: "Conditional View Processing"
    publisher: Django docs
    url: https://docs.djangoproject.com/en/5.2/topics/conditional-view-processing/
    accessed: 2026-11-19
    license: "BSD-3-Clause"
  - id: S2
    title: "Fetch Standard"
    publisher: WHATWG
    url: https://fetch.spec.whatwg.org/
    accessed: 2026-11-19
    license: "CC-BY-4.0"
---
# Answer conditional GET with ETag and If-None-Match
**Answer:** A client can check whether its copy of a page is still current. The server may send an `ETag` header and a `Last-Modified` header. The client later sends `if-none-match` with the last ETag it was sent, or `if-modified-since` with the last modification time. If the current version of the page matches, the server can send a 304 status code instead of a full response, so the client knows nothing changed.

## Django's condition decorator

The `condition` decorator takes `etag_func` and `last_modified_func`. The two functions, to compute the ETag and the last modified time, will be called as the response is prepared. HTTP clients can send headers that tell the server about copies of a resource they already have. | if-none-match | if-modified-since |
|---|---|
| `if-none-match` | The last ETag the client was sent |
| `if-match` | An ETag header |
| `if-modified-since` | The date of the last modification time it was sent |
| `if-unmodified-since` | A last modification date |

These headers are optional on HTTP responses.

## What Fetch sends

If a stored response's header list contains `ETag`, then Fetch appends `if-none-match` with that ETag's value to the request. The Fetch Standard also discusses `if-modified-since`, `if-unmodified-since`, `if-match`, and `if-range` when it sets cache mode. A status that is 304 is not an ok status in the 200 to 299 range.

## See also

- [http-status-codes](https://iinventedlight.com/library/notes/http-status-codes/)
- [django-request-response](https://iinventedlight.com/library/notes/django-request-response/)
- [django-views](https://iinventedlight.com/library/notes/django-views/)

## Claims

- id: C1
  claim: A view can send ETag and Last-Modified headers on a response.
  source: S1
  evidence: "it might provide two HTTP headers: the ETag header"

- id: C3
  claim: If the page is unchanged, the server can send a 304 status code.
  source: S1
  evidence: "a 304 status code can be sent back, instead of a full response"

- id: C4
  claim: Fetch revalidates a stored response by sending If-None-Match from its ETag.
  source: S2
  evidence: "append (` If-None-Match `, ` ETag `'s value )"

## Sources

- [S1] Conditional View Processing. Django docs. https://docs.djangoproject.com/en/5.2/topics/conditional-view-processing/ . License: BSD-3-Clause. Accessed 2026-11-19.

- [S2] Fetch Standard. WHATWG. https://fetch.spec.whatwg.org/ . License: CC-BY-4.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Django docs, Conditional View Processing; WHATWG, Fetch Standard. BSD-3-Clause; CC-BY-4.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
