NewWatchdog: we re-check your site every day and email you when AI agents get blocked →
AgentsReady
Guides · As of

How to keep the files AI agents read from going stale

Agents don't read your llms.txt, API spec or pricing.md once. They cache them and come back. To keep those copies right, send an ETag or Last-Modified header on every machine-readable file, answer a request that sends it back with 304 Not Modified when nothing changed, and set a Cache-Control max-age that matches how often the file changes. Then date the content itself (a "Last updated" line, dateModified in JSON-LD, info.version in OpenAPI) and generate these files from the same source as your pages in CI, so they can't drift from what the site says.

Why freshness matters more than presence

Most agent-readiness advice stops at "publish llms.txt". The harder problem comes later: an agent or a memory layer saved your pricing in October, you changed it in November, and it keeps quoting the old number. SeedToScale's essay Agents need a scalable data world (Nov 2026) names the three costs that keep coming back: stale context, curating the same sources again and again, and recomputing work that didn't need it.

A site can't control what an agent remembers, but it can make checking cheap and make the answer clear: this file hasn't changed, or it has, and here is when.

What each header does

  1. ETag

    A fingerprint of the file's current version. The agent keeps it and sends it back as If-None-Match next time.

  2. Last-Modified

    When the file last changed. The fallback for clients that send If-Modified-Since. Send both if you can.

  3. 304 Not Modified

    The reply to a conditional request when nothing changed: a few hundred bytes instead of the whole file. Most CDNs and static hosts do this for you as long as the ETag is there.

  4. Cache-Control

    How long a copy stays good without asking. max-age=3600 means an hour; max-age=0, must-revalidate means always ask, which is fine when you answer 304.

Check yours in two commands

The first request shows the validators your server sends. The second sends the ETag back and should print 304.

curl -sI https://example.com/llms.txt | grep -iE "etag|last-modified|cache-control"

ETAG=$(curl -sI https://example.com/llms.txt | grep -i '^etag' | cut -d' ' -f2- | tr -d '\r')
curl -s -o /dev/null -w "%{http_code}\n" -H "If-None-Match: $ETAG" https://example.com/llms.txt

Where the headers go missing

  1. Files served by app code

    A route that builds llms.txt or pricing.md on each request often sends no ETag. Return one (a hash of the body works) and compare it with If-None-Match yourself, or serve the file as a static asset so the host adds it.

  2. CDNs that strip validators

    Some edge rules drop ETag when they compress or rewrite a response. Check the header from outside, not on your origin.

  3. Different files, different rules

    Teams set caching for HTML and images and forget the .txt, .md and .json files agents read. Our scans on 27 Nov 2026 found agentsready.dev answering 304 on all three of its files, Supabase on 1 of 4 (only its OpenAPI spec), and Telnyx and Stripe on none: their llms.txt carries no ETag or Last-Modified.

Date the content, not just the response

Headers tell a client whether bytes changed. People and models also need to know when the facts were true. Put a "Last updated" line at the top of llms.txt and pricing.md, dateModified in the page's JSON-LD, and a real info.version in your OpenAPI spec that changes when the API does.

For facts that change often, such as prices, rate limits and plan limits, say "as of" with a date next to them, so an answer engine quoting you can pass the date on.

Stop the files drifting from the site

  1. One source

    Generate llms.txt, llms-full.txt, pricing.md and the OpenAPI spec at build time from the same data as your pages, instead of editing them by hand.

  2. Check on every pull request

    Run a check in CI that fails when a link in llms.txt breaks or a machine-readable file disagrees with the page. The AgentsReady GitHub Action scores the site on every pull request.

  3. Watch it after launch

    Sites drift between deploys too, when a firewall rule or CDN setting changes. Watch your site from the bottom of any AgentsReady report for a weekly re-check by email.

Check it yourself

Should print an ETag or Last-Modified line and a Cache-Control line. Run the same for /llms-full.txt, /openapi.json and /pricing.md. A full check reports all four on the "Agents can tell what changed" row.

curl -sI https://example.com/llms.txt | grep -iE "etag|last-modified|cache-control"
Run the free check on your siteGet the full checklist

Questions

Do AI agents actually send If-None-Match?

HTTP caches, CDNs and clients built on standard caching libraries do it automatically when the server gives them an ETag. An agent or tool that keeps fetched pages between runs needs it too: without a validator it can only download everything again or trust an old copy.

Is a weak ETag (W/"...") good enough?

Yes, for this purpose. Weak ETags work for If-None-Match and 304 responses; most CDNs send them for compressed files.

Should I set a long max-age on llms.txt?

Match how often it changes. An hour to a day is common. If you deploy often, use a short max-age with an ETag so clients re-check cheaply.

How do I keep pricing.md in sync with my pricing page?

Build both from the same data at deploy time, and add a CI check that compares the plan names and prices in each. A hand-written pricing.md drifts within weeks.