vlt / affordances
  • Quickstart
  • Concepts
  • Guides
  • Reference
  • Overview
  • Setup
  • Markers
  • What gets converted
  • Caching and privacy
  • llms.txt and llms-full
  • htmlToMarkdown
  • Behind a proxy
  1. Plugins
  2. /
  3. Markdown
  4. /
  5. Caching and privacy

Caching and privacy

The Markdown is the page that caller would see, and it's only cached when the page is public.

The handler forwards the caller's cookie, authorization, and accept-language headers, so a signed-in agent gets the page that person would see. Everything about that response stays personal:

  • With a cookie or bearer token, or when the page is private or no-store, or sets a cookie, the Markdown is sent with Cache-Control: private, no-store.
  • Otherwise it keeps the page's own Cache-Control.
  • Every response has Vary: Accept, X-Affordances-Tokens with an estimate of its length in tokens, and a Link to the canonical page when it has one.

The status code is the page's. A redirect to the same site stays in Markdown (to the target's .md); one to another origin is passed on, never followed. A page that takes longer than 10 seconds answers 504, and one larger than 6 MB answers 413.

Behind a proxy

The handler fetches pages from the request's own origin. When a proxy changes it, set AFFORDANCES_MD_ORIGIN, or build the handler with options:

app/api/affordances/md/[[...path]]/route.ts
import { createMdHandler } from '@affordances/md/next'

export const GET = createMdHandler({ origin: 'http://localhost:3000', timeout: 5000 })
OptionDefaultDescription
originthe request'sWhere to fetch pages from
timeout10000Milliseconds before answering 504
maxBytes6 MBThe largest page it converts
appendnoneMore Markdown after the page's, such as an actions summary

PreviousWhat gets convertedNextllms.txt and llms-full

On this page

  • Behind a proxy
Edit this page

Make your app agent-operable

Give every page a graph and every server action an agent path: HTTP, WebMCP, and MCP, with the same session and the same checks. One command sets it up.

Read the quickstart