MCPcopy Create free account
hub / github.com/denoland/std / formatCacheControl

Function formatCacheControl

http/unstable_cache_control.ts:419–440  ·  view source on GitHub ↗
(cc: CacheControl)

Source from the content-addressed store, hash-verified

417 * valid HTTP token (RFC 9110 §5.6.2).
418 */
419export function formatCacheControl(cc: CacheControl): string {
420 const d: CacheControl = cc;
421 const out: string[] = [];
422 append(out, "max-age", d.maxAge);
423 append(out, "no-cache", d.noCache);
424 append(out, "no-store", d.noStore);
425 append(out, "no-transform", d.noTransform);
426 append(out, "max-stale", d.maxStale);
427 append(out, "min-fresh", d.minFresh);
428 append(out, "only-if-cached", d.onlyIfCached);
429 append(out, "s-maxage", d.sMaxage);
430 append(out, "private", d.private);
431 append(out, "public", d.public);
432 append(out, "must-revalidate", d.mustRevalidate);
433 append(out, "proxy-revalidate", d.proxyRevalidate);
434 append(out, "must-understand", d.mustUnderstand);
435 append(out, "immutable", d.immutable);
436 append(out, "stale-while-revalidate", d.staleWhileRevalidate);
437 append(out, "stale-if-error", d.staleIfError);
438
439 return out.join(", ");
440}

Callers 1

Calls 1

appendFunction · 0.85

Tested by

no test coverage detected