Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
title isPro

Type: |

It sets the maximum quantity of time a resource can be cached before be considered as expired over the target url.

<MultiCodeEditor languages={mqlCode('', { ttl: '1d' })} />

The value provided need to be at least 1 minute and not higher than 31 days, being supported the following formats:

  • as number in milliseconds (e.g., ).
  • as humanized representation of the number (e.g., ).

The following humanized number variations are supported:        # 86400000      # 86400000     # 86400000        # 3600000     # 3600000    # 3600000       # 90000    # 90000  # 90000 # 90000

Additionally, we provide and aliases:     # equivalent to `1m`     # equivalent to `31d`

The purpose of this API parameter is to adapt our caching layer based on your necessities:

  • If you are targetting a URL that changes very often and response time is not critical for you, a small value will work better.
  • If you are targetting a URL that doesn't change too much or you want to maximize cache hits, getting faster response time, a higher value works better.

The value provided will reflected as x-cache-ttl as part of the response headers.