@helia/verified-fetch
Version:
A fetch-like API for obtaining verified & trustless IPFS content on the web
29 lines • 1.27 kB
TypeScript
interface CacheControlHeaderOptions {
/**
* This should be seconds as a number.
*
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives
*/
ttl?: number;
protocol: string;
response: Response;
}
/**
* Implementations may place an upper bound on any TTL received, as noted in Section 8 of [rfc2181].
* If TTL value is unknown, implementations should not send a Cache-Control
* No matter if TTL value is known or not, implementations should always send a Last-Modified header with the timestamp of the record resolution.
*
* @see https://specs.ipfs.tech/http-gateways/path-gateway/#cache-control-response-header
*/
export declare function setCacheControlHeader({ ttl, protocol, response }: CacheControlHeaderOptions): void;
/**
* This function returns the value of the `Content-Range` header for a given
* range.
*
* If you know the total size of the body, pass it as `byteSize`
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range
*/
export declare function getContentRangeHeader(byteSize: number | bigint | string, byteStart?: number | bigint | string, byteEnd?: number | bigint | string): string;
export {};
//# sourceMappingURL=response-headers.d.ts.map