Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| type CacheMetadata = { | |
| createdTime: number | |
| maxAge: number | null | |
| expires: number | null | |
| } | |
| function shouldRefresh(metadata: CacheMetadata) { | |
| if (metadata.maxAge) { | |
| return Date.now() > metadata.createdTime + metadata.maxAge | |
| } |