doc: document REST cache-control defaults

Co-authored-by: willcl-ark <will@256k1.dev>
This commit is contained in:
w0xlt
2026-03-18 10:56:38 -07:00
parent 862a179556
commit bbe21ac29f

View File

@@ -12,6 +12,25 @@ REST Interface consistency guarantees
The [same guarantees as for the RPC Interface](/doc/JSON-RPC-interface.md#rpc-consistency-guarantees)
apply.
Default HTTP caching
--------------------
REST responses include `Cache-Control` headers by default:
* `public, immutable, max-age=86400` for `/block` and `/block/notxdetails`
binary and hex responses, `/blockpart`, `/blockfilter` and `/spenttxouts` in
all formats, and `/deploymentinfo/<BLOCKHASH>.json`. The TTL is deliberately
short so caches do not hold older response shapes across software upgrades.
* `no-store` for `/block` and `/block/notxdetails` JSON, `/tx`, `/headers`,
`/blockfilterheaders`, `/blockhashbyheight`, `/chaininfo`, `/mempool`,
`/getutxos`, `/deploymentinfo.json`, and all error responses. These responses
can change with active chain or node state and do not currently provide cache
validators such as `ETag` or `Last-Modified`.
If you front `bitcoind` with a reverse proxy or CDN such as Caddy or nginx with
the headers-more module, you can override these defaults there. Keep overrides
scoped to responses you know are safe to cache more aggressively.
Limitations
-----------