---
title: "Cache headers for agent re-fetches | Agent Ready Checklist"
description: "Which headers let agents re-fetch llms.txt, sitemap.xml and openapi.json cheaply? Covers ETag, Last-Modified, Cache-Control: no-cache and Vary: Accept."
canonical: https://agentreadychecklist.com/guides/cache-headers-and-conditional-requests-for-agents
site: "Agent Ready Checklist"
last_updated: 2026-11-18
date: 2026-11-18
section: "Guides"
---

# Cache headers for agent re-fetches | Agent Ready Checklist

> Which headers let agents re-fetch llms.txt, sitemap.xml and openapi.json cheaply? Covers ETag, Last-Modified, Cache-Control: no-cache and Vary: Accept.

Source: https://agentreadychecklist.com/guides/cache-headers-and-conditional-requests-for-agents
Site: Agent Ready Checklist
Last reviewed: 2026-11-18
Agent endpoints: https://agentreadychecklist.com/llms.txt (index), https://agentreadychecklist.com/openapi.json (API), https://agentreadychecklist.com/mcp (MCP server), https://agentreadychecklist.com/ask (search)
Access: https://agentreadychecklist.com/auth.md (no key). Pricing: https://agentreadychecklist.com/pricing.md (free).

# ETag and Last-Modified let agents re-fetch with a 304

Give llms.txt, sitemap.xml and openapi.json both validators, an ETag and a Last-Modified date, plus Cache-Control: no-cache, which bars reuse of a stored copy until it is revalidated. Where one URL returns HTML or markdown, send Vary: Accept and give each variant its own ETag.

A returning agent or crawler checks its stored copy with a conditional request that carries If-Modified-Since or If-None-Match. When the file has not changed, the server answers 304 Not Modified with no response body, so the transfer is extremely small. Crawlers also read Last-Modified to adjust how often they crawl ([MDN's caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)).

## Start with llms.txt, sitemap.xml and openapi.json

Put validators on these three discovery files before anything else. That follows the [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) rule: an origin server should send an ETag for any representation whose changes it can reasonably and consistently detect, and should send Last-Modified for any whose last modification date it can reasonably and consistently determine.

Serve each file with Cache-Control: no-cache alongside Last-Modified and ETag, the pattern [MDN's caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching) gives to force revalidation:

```http
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1024
Cache-Control: no-cache
Last-Modified: Tue, 22 Feb 2022 20:20:20 GMT
ETag: "AAPuIbAOdvAGEETbgAAAAAAABAAE"
```

The guide applies the same headers to favicon.ico, manifest.json, .well-known and API endpoints whose URLs cannot be changed using cache busting. Putting no-cache in the default Cache-Control value is common practice, so that by default the latest version of a resource is always transferred.

Related: [Ship llms.txt and link it](https://agentreadychecklist.com/guides/ship-llms-txt-and-link-it/)

## Build the two validators

Make the ETag an opaque quoted string. Tags are strong by default, and a W/ prefix marks a weak one ([RFC 9110](https://www.rfc-editor.org/rfc/rfc9110)). Implementations might build one from a collision-resistant hash of the content, a combination of file attributes, or a modification timestamp with sub-second resolution.

Last-Modified takes an HTTP-date, and HTTP-dates resolve only to the second. That limit is one case where an entity tag can be more reliable for validation than a modification date.

Send both headers on a 200 response if possible, a preference [the MDN guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching) attributes to RFC 9110. When a request arrives carrying both If-None-Match and If-Modified-Since, If-None-Match takes precedence.

## What the returning client sends

A cache that revalidates a stored response must send back the entity tags it stored, in If-Match, If-None-Match or If-Range ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)). It should put the stored Last-Modified value in If-Modified-Since when it validates a single stored response and the request is not for a subrange. A 304 in reply means the stored response can be updated and reused.

## Choose the Cache-Control directives

Set the freshness lifetime with max-age. While a response is fresh, it can answer later requests without contacting the origin server ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)). With no-cache, a stored response cannot be reused unless it is successfully validated.

The must-revalidate directive forbids reusing a stale response without revalidation ([MDN on caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)). Servers ought to send must-revalidate if and only if failure to validate a request could cause incorrect operation, such as a silently unexecuted financial transaction ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)).

If one of these files carries personalized content that you want stored only in the private cache, you must mark it private. Unqualified, private bars a shared cache from storing the response, while a private cache may store it.

## Set the lifetime explicitly

Give each discovery file an explicit expiration time with max-age or Expires. Without one, a cache may assign a heuristic expiration time from other fields such as Last-Modified ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)). A public directive on a response with no explicit freshness marks it explicitly cacheable, and caches can apply heuristics to such a response. For a response with Last-Modified, caches are encouraged to keep the heuristic value no more than some fraction of the time since that date, and a typical setting of the fraction might be 10%. Once an explicit expiration time is present in the stored response, caches must not use heuristics.

Heuristic caching is a workaround that came before Cache-Control support was widely adopted, and basically all responses should carry an explicit Cache-Control header ([MDN's caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)).

## Add Vary: Accept when one URL serves HTML and markdown

Send Vary: Accept on any URL that returns HTML or markdown depending on the request. A response subject to proactive negotiation often carries Vary to name the parts of the request used to select it, and Accept is one of the request fields defined for that negotiation ([RFC 9110](https://www.rfc-editor.org/rfc/rfc9110)). A cache must not reuse a stored response unless the request headers it nominates match the new request ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)).

Related: [Vary: Accept defined](https://agentreadychecklist.com/glossary/vary-accept/)

Caches tell responses apart essentially by URL, but under content negotiation a response can depend on Accept. Naming a request header in Vary keys the cache on the URL and that header together ([MDN caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)).

Related: [VERCEL-NEGOTIATION-HEADERS](https://agentreadychecklist.com/checklist/vercel-negotiation-headers/)

## Give each variant its own ETag

Give the HTML and the markdown variants separate ETags. A strong validator changes whenever the content a GET would return in a 200 changes, and a weak one might not change every time ([RFC 9110](https://www.rfc-editor.org/rfc/rfc9110)). One tag shared by two representations at once is weak unless their data is identical, so the same tag on a gzip-coded body and an uncoded one is weak, and an origin server must mark such a tag with W/. To tell representations apart, an implementation might use an internal revision number, perhaps combined with a variance identifier for content negotiation.

A change of content encoding also requires a change to the ETag, and some servers modify ETags when they compress responses ([MDN on conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests)).

Weak tags are usable when the client does not need exact equality with data it obtained before, as when validating a cache entry. Strong tags work for every conditional request, partial content ranges included. When a 304 carries a strong validator, only stored responses with that same validator are updated ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)).

Related: [Glossary](https://agentreadychecklist.com/glossary/)

## Test with a fetch, then a conditional request

Fetch one of your pages with an agent user-agent string, the check the [AgentReady spec](https://github.com/agentready-org/standard/blob/main/spec/spec.md) describes:

```sh
curl -iL -A 'Claude-User/1.0' https://example.com/your-page
```

The request should end with a 200, and intermediate 301 or 308 redirects are acceptable. Read ETag, Last-Modified, Cache-Control and Vary from the printed headers. Check Vary on that GET rather than on a HEAD request: a server may omit from a HEAD response the header fields it determines only while generating the content, and Vary is one example ([RFC 9110](https://www.rfc-editor.org/rfc/rfc9110)).

Next, copy the ETag into If-None-Match, as in the request from [MDN's caching guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching):

```sh
curl -i -H 'Accept: text/html' -H 'If-None-Match: "33a64df5"' https://example.com/index.html
```

For each of your files, a pass is a 304 Not Modified while the file is unchanged, which the server returns when the ETag it determines for the resource equals the If-None-Match value. After the server decides the resource should have a different ETag, a pass is a 200 OK carrying the latest version.

## Sources

-   [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110)IETF / RFC Editor, read 2026-11-18
-   [RFC 9111: HTTP Caching](https://www.rfc-editor.org/rfc/rfc9111)IETF / RFC Editor, read 2026-11-18
-   [HTTP conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests)MDN, read 2026-11-18
-   [HTTP caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)MDN, read 2026-11-18
-   [AgentReady spec](https://github.com/agentready-org/standard/blob/main/spec/spec.md)AgentReady standard repository, read 2026-11-18

Edition

Data

2026-11-04

Reviewed

2026-11-18

Spec

AgentReady v2.0.1, db79f10

Crawl

13,071 rows, 2026-11-04

Ora

132 checks, contract 1.38.0, 2026-11-05

Verify with Ora

The scanner this site recommends for the whole checklist. 132 checks, a score out of 100, no account.

`npx ax@0.10 audit <url> --min-score <n>`

[Why Ora, and its limits](https://agentreadychecklist.com/verify-with-ora/)

Method

-   [How rows, commands and rates are made](https://agentreadychecklist.com/method/)
-   [How an Ora check is matched to a row](https://agentreadychecklist.com/checklist/ora-checks/)
-   [Pass rates by rank band](https://agentreadychecklist.com/data/by-rank/)

Sources and read dates sit at the foot of the page.

Last reviewed 2026-11-18. AgentReady v2.0.1, read 2026-11-24.
