Swap-Aggregator-Subgraph/node_modules/http-basic/lib/cache-control-utils.d.ts
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

15 lines
547 B
TypeScript

import { CachedResponse } from './CachedResponse';
import Response = require('http-response-object');
export declare type Policy = {
maxage: number | null;
};
/**
* returns true if this response is cacheable (according to cache-control headers)
*/
export declare function isCacheable<T>(res: Response<T> | CachedResponse): boolean;
/**
* if the response is cacheable, returns an object detailing the maxage of the cache
* otherwise returns null
*/
export declare function cachePolicy<T>(res: Response<T> | CachedResponse): Policy | null;