release: WRNexusJS 0.7.0

This commit is contained in:
2026-08-01 10:04:42 +05:30
parent c54144f2e4
commit 87507edf59
207 changed files with 12607 additions and 679 deletions
+5
View File
@@ -89,6 +89,8 @@ export interface CacheControlOptions {
noCache?: boolean;
/** stale-while-revalidate window in seconds. */
staleWhileRevalidate?: number;
/** stale-if-error window in seconds. */
staleIfError?: number;
immutable?: boolean;
}
@@ -104,6 +106,9 @@ export function cacheControl(options: CacheControlOptions): string {
if (options.staleWhileRevalidate !== undefined) {
parts.push(`stale-while-revalidate=${Math.max(0, Math.floor(options.staleWhileRevalidate))}`);
}
if (options.staleIfError !== undefined) {
parts.push(`stale-if-error=${Math.max(0, Math.floor(options.staleIfError))}`);
}
if (options.immutable) parts.push("immutable");
return parts.join(", ");
}