Add built-in set of cacheLife profiles (#71322)
```
cacheLife: {
"seconds": {
stale: 30, // 30 seconds
revalidate: 1, // 1 second
expire: 1, // 1 minute
},
"minutes": {
stale: 60 * 5, // 5 minutes
revalidate: 60, // 1 minute
expire: 60 * 60, // 1 hour
},
"hours": {
stale: 60 * 5, // 5 minutes
revalidate: 60 * 60, // 1 hour
expire: 60 * 60 * 24, // 1 day
},
"days": {
stale: 60 * 5, // 5 minutes
revalidate: 60 * 60 * 24, // 1 day
expire: 60 * 60 * 24 * 7, // 1 week
},
"weeks": {
stale: 60 * 5, // 5 minutes
revalidate: 60 * 60 * 24 * 7, // 1 week
expire: 60 * 60 * 24 * 30, // 1 month
},
"max": {
stale: 60 * 5, // 5 minutes
revalidate: 60 * 60 * 24 * 30, // 1 month
expire: Infinity, // Unbounded. Whatever max your host stores.
}
}
```
The stale time is either 30 seconds or 5 minutes which correspond to our
existing default for dynamic/static data. If you have overridden the
`staleTimes` options, we default for those. `"seconds"` means basically
dynamic.
The revalidate time is the beginning of the range and the expire is the
end of that range. So `"days"` refreshes somewhere after 1 day and
before 1 week.
Showing
Please
register
or
sign in
to comment