fix: avoid caching non-positive TTL entries

This commit is contained in:
Mo Elzubeir
2026-05-29 14:39:04 -05:00
parent d820a39223
commit 4ccf060a3e
3 changed files with 29 additions and 2 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ interface Cache {
}
```
The cache key is the full request URL. `ttlMs` is in milliseconds and comes from `cacheTtlMs` or per-request `revalidateSeconds`.
The cache key is the full request URL. `ttlMs` is in milliseconds and comes from `cacheTtlMs` or per-request `revalidateSeconds`. A non-positive `ttlMs` means "do not cache"; built-in caches delete/skip the entry rather than storing it forever.
## Redis-style cache example