Skip to main content
cache is true by default: the plugin builds the document once and reuses it for every request until the process restarts.

Why this is safe

The Payload config is static after boot — collections, globals, fields, and endpoints cannot change while the server runs. So the document is identical on every request, with one exception: the server URL, which is always filled in fresh from the request’s Host header, cached or not.

Disable it in development

In development your config changes often. Turn the cache off so edits show up without a restart:
payload.config.ts
If you never want a live spec endpoint at all, cache is not the option you’re looking for — set serve: false and generate the file with the CLI instead. See Static spec.