staleTtl
PRO

Type:
<string> | <number> | <boolean>

Default: false
It enables serve a stale response while a background refresh cache copy is being generated over the target url.

Interactive Code Editor

Test API requests with multiple programming languages. Edit code, execute requests, and view responses in real-time.

The value provided can't be higher than ttl, being supported the following formats:
  • as number in milliseconds (e.g., 86400000).
  • as humanized representation of the number (e.g., '24h').
The following humanized number variations are supported:
A good pattern is to set staleTtl=0 to always revalidate in the background under expiration, maximizing the cache usage serving the last cache copy generated while the revalidation will refresh it.