Page Setting
page setting is setting key at level 0 inside the json file
"setting": {
"ttl": { ... }
}
TTL
The ttl
object defines the lifetime policy for cached resources.
It controls how long a resource remains valid before the system considers it stale and requests a fresh copy.
Strategies
The strategy
field defines the caching rule to apply:
-
Transient The resource is cached for a limited duration, defined by
transient-value
. -
transient-value
accepts multiple formats:- Relative durations:
10s
= 10 seconds5mn
= 5 minutes7d
= 7 days2mth
= 2 months
- Absolute ISO UTC datetime:
"2025-09-15T00:00:00Z"
- Date:
- 00h00 is applied.
- Time of day:
"03:00"
→ if before current time, same day is applied;
if above current time, next day is applied.
- Relative durations:
"setting": {
"ttl": {
"strategy": "transient",
"transient-value": "5mn"
}
}
- Single-use The resource is valid only for a single access. After being used once, it is purged from the cache.
"setting": {
"ttl": {
"strategy": "single-use"
}
}
Default Behavior
If ttl
is absent:
-
Global and Local resources:
Cached indefinitely, until thevalidity-key
defined in the config changes. Refer to the Config No expiration is applied unless explicitly declared. -
Contextual resources:
Cached with a single-use policy by default, even without explicitttl
.
Summary
ttl
is optional but recommended for dynamic resources.- Strategies:
- transient → expires after a duration (
transient-value
) or at a given date/time. - single-use → removed from cache immediately after first use.
- transient → expires after a duration (
- Defaults:
- Global/Local = infinite until
validity-key
changes. - Contextual = single-use if not specified.
- Global/Local = infinite until
- Use ISO UTC datetimes or shorthand units (
s
,mn
,d
,mth
) fortransient-value
.