/Knowledge/sources/honojs__hono/llms-full/cache-middleware-options-keygenerator-c-context-string-promise--12eea26409c4.md
Cache Middleware: Options > keyGenerator: (c: Context) => string | Pr...
Cache Middleware: Options keyGenerator: (c: Context) = string | Promise Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono....
Cache Middleware: Options > keyGenerator: (c: Context) => string | Promise
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#keygenerator-c-context-string-promise
Summary
Generates keys for every request in the cacheName store. This can be used to cache data based on request parameters or context parameters. The default is c.req.url.
Content
Generates keys for every request in the cacheName store. This can be used to cache data based on request parameters or context parameters. The default is c.req.url.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#keygenerator-c-context-string-promise",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Cache Middleware > Options > keyGenerator: `(c: Context) => string | Promise `",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 282,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Cache Middleware: Options > keyGenerator: (c: Context) => string | Promise",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}